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


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={
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.