| 466 | self._writer = None |
| 467 | |
| 468 | def send(self, writer, reader): |
| 469 | writer.set_tcp_cork(True) |
| 470 | request = aiohttp.Request(writer, self.method, self.path, self.version) |
| 471 | |
| 472 | if self.compress: |
| 473 | request.add_compression_filter(self.compress) |
| 474 | |
| 475 | if self.chunked is not None: |
| 476 | request.enable_chunked_encoding() |
| 477 | request.add_chunking_filter(self.chunked) |
| 478 | |
| 479 | class="cm"># set default content-type |
| 480 | if (self.method in self.POST_METHODS and |
| 481 | hdrs.CONTENT_TYPE not in self.skip_auto_headers and |
| 482 | hdrs.CONTENT_TYPE not in self.headers): |
| 483 | self.headers[hdrs.CONTENT_TYPE] = &class="cm">#x27;application/octet-stream' |
| 484 | |
| 485 | for k, value in self.headers.items(): |
| 486 | request.add_header(k, value) |
| 487 | request.send_headers() |
| 488 | |
| 489 | self._writer = helpers.ensure_future( |
| 490 | self.write_bytes(request, reader), loop=self.loop) |
| 491 | |
| 492 | self.response = self.response_class( |
| 493 | self.method, self.url, self.host, |
| 494 | writer=self._writer, continue100=self._continue) |
| 495 | self.response._post_init(self.loop) |
| 496 | return self.response |
| 497 | |
| 498 | @asyncio.coroutine |
| 499 | def close(self): |