We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Currently the set and append header methods on Response take a static str for the key:
pub fn set_header(self, key: &'static str, value: impl AsRef<str>) -> Self; pub fn append_header(self, key: &'static str, value: impl AsRef<str>) -> Self;
I'd like to be able to specify arbitrary header names:
pub fn set_header(self, key: &str, value: impl AsRef<str>) -> Self; pub fn append_header(self, key: &str, value: impl AsRef<str>) -> Self;
Example usecases:
The text was updated successfully, but these errors were encountered:
For reference, my current workaround:
let mut res = tide::http::Response::builder(); res.status(meta.status); for (key, value) in meta.headers { res.header(key.as_slice(), value.as_slice()); } let res = tide::Response::from(res.body(http_service::Body::empty())?);
Sorry, something went wrong.
This has been fixed since #414 (0.7.0). The header apis now use http_types::headers::HeaderName, which uses String internally.
http_types::headers::HeaderName
String
No branches or pull requests
Currently the set and append header methods on Response take a static str for the key:
I'd like to be able to specify arbitrary header names:
Example usecases:
The text was updated successfully, but these errors were encountered: