Skip to content
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

Add append_header to RequestBuilder or make header types fully public #362

Open
laundmo opened this issue Sep 26, 2024 · 0 comments
Open

Comments

@laundmo
Copy link

laundmo commented Sep 26, 2024

Currently, if i want to use RequestBuilder with multiple values for the same header, i have to construct a weird iterator using HeaderValue::from_str since the necessary tools to do this are missing.

I cannot:

  • simply loop and call append_header, since RequestBuilder doesn't have this
  • construct a Headers, since its private and i can't pass it to RequestBuilder
  • construct and HeaderValues for RequestBuilder::header since its private

The only way i want to have multiple header values with RequestBuilder, i need to do this:

builder = builder.header(
    name,
    vec!["a", "b"]
        .iter()
        .map(|f| HeaderValue::from_str(f).unwrap().collect()),
);

which is quite clunky

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant