(self, headers, body, newline=b"\r\n")
| 206 | return Application(self.get_handlers()) |
| 207 | |
| 208 | def raw_fetch(self, headers, body, newline=b"\r\n"): |
| 209 | with closing(IOStream(socket.socket())) as stream: |
| 210 | self.io_loop.run_sync( |
| 211 | lambda: stream.connect(("127.0.0.1", self.get_http_port())) |
| 212 | ) |
| 213 | stream.write( |
| 214 | newline.join(headers + [utf8("Content-Length: %d" % len(body))]) |
| 215 | + newline |
| 216 | + newline |
| 217 | + body |
| 218 | ) |
| 219 | start_line, headers, body = self.io_loop.run_sync( |
| 220 | lambda: read_stream_body(stream) |
| 221 | ) |
| 222 | return body |
| 223 | |
| 224 | def test_multipart_form(self): |
| 225 | # Encodings here are tricky: Headers are latin1, bodies can be |
no test coverage detected