Issue
I have tried requests.post in Django but it was not working. It was fine with request.get.
headers = {'Content-type': 'application/json'}
answer = requests.post('http://www.testing/getdata', data = {'testing': 'testing'}, verify=False,auth=(testing,testing),headers=headers)
Results:
"Unexpected Error Occurred:RESTEASY008200: JSON Binding deserialization error"
Solution
You sent form data, but you set headers like you sent json.
I guess you wanna do something like that:
headers = {'Content-type': 'application/json'}
answer = requests.post('http://www.testing/getdata', json = {'testing': 'testing'}, verify=False,auth=(testing,testing),headers=headers)
Answered By - Sharpek
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.