Reputation: 305
I'm implementing a jira api call : Add watcher to a JIRA issue.
It takes a String
parameter instead of JSON
.
I'm using python requests.
requests.post(url, headers=headers, json=data)
What should be my value of data if the jira documentation says I need to pass just String but requests.post
method only accepts JSON?
Upvotes: 13
Views: 27845
Reputation: 2460
Simply do:
requests.post(url, headers=headers, data=data)
According to the official docs:
There are many times that you want to send data that is not form-encoded. If you pass in a
string
instead of adict
, that data will be posted directly.
Upvotes: 25