yaocaigen / httplib2

Automatically exported from code.google.com/p/httplib2
0 stars 0 forks source link

No content-length set for POST with empty body #143

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- What steps will reproduce the problem?
Do a POST with body=""

    import httplib2
    httplib2.debuglevel=1
    h = httplib2.Http()
    h.request("http://www.example.com/somescript", "POST", "")

- What is the expected output? What do you see instead?
Expected "Content-Length: 0", but no such header is there.

- What version of the product are you using? On what operating system?
python-httplib2.noarch 0.6.0-3.fc14 (Fedora 14)

- Please provide any additional information below.
HTTP 1.1 rfc isn't exactly clear on what's required for POST, but some web 
servers (at least lighttpd) will respond 411 Length Required if no 
content-length header is present.

Original issue reported on code.google.com by el...@intra.takeit.se on 18 Apr 2011 at 11:19

GoogleCodeExporter commented 9 years ago
This is with Python 2.7, may hold for other versions as well.

Original comment by el...@intra.takeit.se on 18 Apr 2011 at 11:23

GoogleCodeExporter commented 9 years ago
Any updates on this? Google's OAuth servers
also respond with '411 Length' if the content-length
header is not provided.

Original comment by yesud...@gmail.com on 27 Jul 2011 at 11:05

GoogleCodeExporter commented 9 years ago
So since you can manually set the content-length
header, I think this can be ignored.

Original comment by yesud...@gmail.com on 27 Jul 2011 at 11:44