-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow iteration over headers, and enable multiple headers of a name #19
Comments
Judging by this code the last parsed header with the same name will be present in the headers (silently dropping others).
Currently, I don't believe so, I think you'd have to have a dependency on the implementation of the svc traits. Currently, in esp-idf-svc, headers are stored in a
I agree! I've used it before, it's very nice! A PR would be most welcome :) |
I suggest let's wait here a week or so. I'm in the midst of doing some refactoring on the traits here so that all of those + the majority of the stuff in the One of the affected traits is the The reason for all that is that ideally, we would like to support "Embassy-style" "all-static" "no-heap" "single-stack" async type of apps on ESP32 bare metal (ESP-IDF would always be the alloc STD-compatible thing though), as the former means much more runtime predictability (as in no stack overflows and allocation failures) which in turns results in more resilient firmware and makes a really good story for bare-metal Rust. As for inspiring ourselves from the |
Sounds good. And just to clarify, I'm not expecting to get full parity with |
Hi there. I'm trying to convert to and from the
http
crate Request and Response types while actually sending the request through anembedded_svc::http::client::Client
instance. I noticed while trying to rebuild the response thatembedded_svc::http::Headers
trait's API does not provide an iterator over header/value pairs, but rather provides a "key lookup" style API, e.g.let header = response.header("header name")
. I have a few questions about this:Headers
trait, does it simply return a comma-separated string to indicate multiple values for the given header? Or are multiple values by the same header name silently dropped?Headers
trait, is there any way to enumerate all of the names of headers in a response? It seems not.I think that the
http
crate does a really good job at capturing the nuances of the http protocol, so it'd be nice if the http traits here were expressive enough to allow for a full round-trip conversion without loss of information (for suitable body types).The text was updated successfully, but these errors were encountered: