Issue #16464: reset Request's Content-Length header on .data change.

It will be recalculated on sending request to HTTP server.

Patch by Alexey Kachayev
This commit is contained in:
Andrew Svetlov 2012-11-27 23:06:19 +02:00
parent 9a270d9741
commit bff98fe536
3 changed files with 72 additions and 2 deletions

View file

@ -408,6 +408,10 @@ request.
The entity body for the request, or None if not specified.
.. versionchanged:: 3.4
Changing value of :attr:`Request.data` now deletes "Content-Length"
header if it was previously set or calculated.
.. attribute:: Request.unverifiable
boolean, indicates whether the request is unverifiable as defined
@ -456,6 +460,12 @@ request.
unredirected).
.. method:: Request.remove_header(header)
Remove named header from the request instance (both from regular and
unredirected headers).
.. method:: Request.get_full_url()
Return the URL given in the constructor.