.. 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)
"""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