'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
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.'

def endheaders(self, message_body=None):

    if (self.__state == _CS_REQ_STARTED):
        self.__state = _CS_REQ_SENT
    else:
        raise CannotSendHeader()
    self._send_output(message_body)
