On Wed, 15 Oct 2014 11:28:42 +1300 Robert Collins <robe...@robertcollins.net> wrote: > On 15 October 2014 11:10, Antoine Pitrou <solip...@pitrou.net> wrote: > > > Each time a connection is accepted, protocol_factory is called without > > arguments(**) to create a Protocol, a bidirectional stream Transport is > > created to represent the network side of the connection, and the two > > are tied together by calling protocol.connection_made(transport).""" > > So where would headers etc be supplied to the protocol for reads (and > for outputs)? Since the transport isn't the raw socket, its the bodies > only.
For reads, it could be provided on e.g. transport.get_extra_info('headers'). Or if you want a flat mapping API, transport.get_extra_info('http_content_type'), etc. As for out-bound headers, it's a good question. But I think it's ok for the transport to have HTTP-specific methods, so transport.write_header(name, value) could be ok too. Regards Antoine. _______________________________________________ Web-SIG mailing list Web-SIG@python.org Web SIG: http://www.python.org/sigs/web-sig Unsubscribe: https://mail.python.org/mailman/options/web-sig/archive%40mail-archive.com