expose Headers::new and Extensions::new
Other users than http-rs might want to use these types, but they cannot currently be constructed outside of this crate
needs a rebase for clippy
I'm okay with this change, but think we should document that this is most likely not what you want to do. Someone coming from hyperium/http may incorrectly assume that Headers instances need to manually be created. Instead this really only serves as an intermediate type that is meant to be accessed through Request, Response, etc. Much like a trait is, but slightly different.
Just exposing this without guidance may cause confusion, and we should try and evade that if possible. (Though it'd be correct to point out that our current guidance on these types isn't great either, and folks may already be confused. But ideally we shouldn't add to that 😅 )
[wrong thread; oops]
I think this could be useful if you could set the headers when constructing a request, at least that would make per-client headers in Surf config a tad nicer under the hood.
I think this could be useful if you could set the headers when constructing a request, at least that would make per-client headers in Surf config a tad nicer under the hood.
why not using Middleware?
Unimportant implementation detail, but feature wise, convenience.