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