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

Support string literal for header built-in functions #33

Open
theredfish opened this issue Feb 16, 2023 · 0 comments · May be fixed by #78
Open

Support string literal for header built-in functions #33

theredfish opened this issue Feb 16, 2023 · 0 comments · May be fixed by #78
Labels
enhancement New feature or request rfc The issue needs to be discussed, documented and approved before any dev
Milestone

Comments

@theredfish
Copy link
Owner

theredfish commented Feb 16, 2023

The API should be a bit more more natural without all the boilerplate for passing expected headers. We keep the current way, for flexibility purpose, but we add the possibility to provide &str tuples :

.headers(vec![
   ("Content-Type", "application/json; charset=utf-8"),
   ("Content-Length", "42"),
])

It will be less verbose compared to :

.headers(contains(vec![
   (
      CONTENT_TYPE,
      HeaderValue::from_static("application/json; charset=utf-8"),
   ),
   (
      CONTENT_LENGTH, HeaderValue::from_static("15")
   )
]))

The same signature should be made availble for setting the http request headers.

@theredfish theredfish added enhancement New feature or request rfc The issue needs to be discussed, documented and approved before any dev labels Feb 16, 2023
@theredfish theredfish added this to the 0.5.0 milestone Feb 16, 2023
theredfish added a commit that referenced this issue Sep 25, 2024
Also add this new type to the `headers` function for the request
builder.

Fix #33
theredfish added a commit that referenced this issue Sep 25, 2024
Also add this new type to the `headers` function for the request
builder.

Fix #33
theredfish added a commit that referenced this issue Sep 25, 2024
Also add this new type to the `headers` function for the request
builder.

Fix #33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request rfc The issue needs to be discussed, documented and approved before any dev
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant