Aug-04-2020, 10:15 AM
environment: OS xUbuntu 18.04.4; Python 3.6.9; httplib2==0.9.2
I'm using httplib2 in such Python code (for some REST POST-request testing):
Authorization: Basic blablabla
but there is nothing like this.
So I need some ideas - how to check out what exactly was sent by httplib2 to the server?
I'm using httplib2 in such Python code (for some REST POST-request testing):
import httplib2, json
httplib2.debuglevel = 4
h = httplib2.Http('.cache')
data = {"quantity": 1,"product": 15, "product_code": "1004"}
data = json.dumps(data)
restEndpointURL='http://localhost:8000/shop/api/cart/?format=json'
h.add_credentials('a_login', 'a_password', 'localhost')
headersDict={'Content-Type':'application/json','accept':'application/json'}
response, content = h.request(restEndpointURL,'POST',data,headers=headersDict)According to this code (httplib2.debuglevel and add_credentials) I suppose to see in the httplib2 debug output something like:Authorization: Basic blablabla
but there is nothing like this.
So I need some ideas - how to check out what exactly was sent by httplib2 to the server?
