API - How to create new issue from POST in Python?

Hello,

I want to create a new issue on a project from Python, but I can’t figure out how to pass the “PRIVATE_TOKEN” in the request.
This is what I am trying, it does not work:
r = requests.post(“https://gitlab.com/api/v3/projects//issues”, data={
“title”:issueform.instance.title,
“description”:issueform.instance.description
},
headers={“PRIVATE_TOKEN”:“”})
print(r.status_code, r.reason)

I get: 401 Unauthorized

Is this a Python or GitLab issue (maybe it rejects doing it this way)?

hello, the header name is PRIVATE-TOKEN with a dash, not underscore.