diff options
| -rw-r--r-- | Doc/library/httplib.rst | 13 | ||||
| -rw-r--r-- | Lib/httplib.py | 6 | ||||
| -rw-r--r-- | Lib/test/test_sys_settrace.py | 4 |
3 files changed, 13 insertions, 10 deletions
diff --git a/Doc/library/httplib.rst b/Doc/library/httplib.rst index 68a0149..fc26f24 100644 --- a/Doc/library/httplib.rst +++ b/Doc/library/httplib.rst @@ -494,11 +494,14 @@ also send your request step by step, by using the four functions below. .. method:: HTTPConnection.endheaders(message_body=None) - Send a blank line to the server, signalling the end of the headers. - The optional message_body argument can be used to pass message body - associated with the request. The message body will be sent in - the same packet as the message headers if possible. The - message_body should be a string. + Send a blank line to the server, signalling the end of the headers. The + optional *message_body* argument can be used to pass a message body + associated with the request. The message body will be sent in the same + packet as the message headers if it is string, otherwise it is sent in a + separate packet. + + .. versionchanged:: 2.7 + *message_body* was added. .. method:: HTTPConnection.send(data) diff --git a/Lib/httplib.py b/Lib/httplib.py index ccd4234..9853285 100644 --- a/Lib/httplib.py +++ b/Lib/httplib.py @@ -939,10 +939,10 @@ class HTTPConnection: """Indicate that the last header line has been sent to the server. This method sends the request to the server. The optional - message_body argument can be used to pass message body + message_body argument can be used to pass a message body associated with the request. The message body will be sent in - the same packet as the message headers if possible. The - message_body should be a string. + the same packet as the message headers if it is string, otherwise it is + sent as a separate packet. """ if self.__state == _CS_REQ_STARTED: self.__state = _CS_REQ_SENT diff --git a/Lib/test/test_sys_settrace.py b/Lib/test/test_sys_settrace.py index df8c56f..1f77f9b 100644 --- a/Lib/test/test_sys_settrace.py +++ b/Lib/test/test_sys_settrace.py @@ -282,11 +282,11 @@ class TraceTestCase(unittest.TestCase): self.compare_events(func.func_code.co_firstlineno, tracer.events, func.events) - def set_and_retrieve_none(self): + def test_set_and_retrieve_none(self): sys.settrace(None) assert sys.gettrace() is None - def set_and_retrieve_func(self): + def test_set_and_retrieve_func(self): def fn(*args): pass |
