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 a message body associated with the request.
(self, message_body=None, *, encode_chunked=False)
| 1344 | self._output(header) |
| 1345 | |
| 1346 | def endheaders(self, message_body=None, *, encode_chunked=False): |
| 1347 | """Indicate that the last header line has been sent to the server. |
| 1348 | |
| 1349 | This method sends the request to the server. The optional message_body |
| 1350 | argument can be used to pass a message body associated with the |
| 1351 | request. |
| 1352 | """ |
| 1353 | if self.__state == _CS_REQ_STARTED: |
| 1354 | self.__state = _CS_REQ_SENT |
| 1355 | else: |
| 1356 | raise CannotSendHeader() |
| 1357 | self._send_output(message_body, encode_chunked=encode_chunked) |
| 1358 | |
| 1359 | def request(self, method, url, body=None, headers={}, *, |
| 1360 | encode_chunked=False): |