Skip to content

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

@laundmo

Description

@laundmo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions