I'm trying to make a post, however each time I did it, I would get a 411 response error. I'm using the requests library in python.
In [1]: r.post(url)
Out[1]: <Response [411]>
So then I specified the content length h = {'content-length' : '0'}
and try again.
In [2]: r.post(url,h)
Out[2]: <Response [200]>
So great, I get a success, however none of the information is posted in.
I think I need to calculate the content-length, which makes sense as it could be "cutting-off" the post.
So my question is, given a url www.example.com/import.php?key=value&key=value
how can I calculate the content-length
? (in python if possible)