-
-
Notifications
You must be signed in to change notification settings - Fork 998
Closed
Labels
Description
So, not something that we need to support as a primary use-case, but something we ought to just think about a little before 1.0, is making sure that our Request and Response models can be used on the server side as well.
For instance...
- It'd be beneficial if libraries like
starlettewere able to lean heavily onhttpx. - It'd make for easier custom transport implementations, if users were able to eg. instantiate a request instance, given the incoming raw request info. (Since that's a bit easier to worth with that the raw byte-wise API.)
A couple of API/implementation notes to go along with this...
URL()should accept the raw bytes URL 4-tuple format that thehttpcoreAPI uses as one of it's options.Request.prepare(...)shouldn't be called automatically on__init__. TheClientshould call it explicitly inbuild_request(). This ensures that we'd be able to instantiate aRequestinstance from the raw HTTP coremethod/url/headers/stream` information, without having additional headers automatically generated on the model.- We might want
Request.raw,Response.raw,Headers.rawproperties, to match up with the existingURL.rawproperty.