WSGI callable to write unbuffered data to the client. This method is also used internally by start_response (to write data from the iterable returned by the WSGI application).
(self, chunk)
| 619 | return self.write |
| 620 | |
| 621 | def write(self, chunk): |
| 622 | """WSGI callable to write unbuffered data to the client. |
| 623 | |
| 624 | This method is also used internally by start_response (to write |
| 625 | data from the iterable returned by the WSGI application). |
| 626 | """ |
| 627 | if not self.started_response: |
| 628 | raise AssertionError("WSGI write called before start_response.") |
| 629 | |
| 630 | if not self.sent_headers: |
| 631 | self.sent_headers = True |
| 632 | self.send_headers() |
| 633 | |
| 634 | if self.chunked_write and chunk: |
| 635 | buf = [hex(len(chunk))[2:], "\r\n", chunk, "\r\n"] |
| 636 | self.wfile.sendall("".join(buf)) |
| 637 | else: |
| 638 | self.wfile.sendall(chunk) |
| 639 | |
| 640 | def send_headers(self): |
| 641 | """Assert, process, and send the HTTP response message-headers.""" |
no test coverage detected