http-types icon indicating copy to clipboard operation
http-types copied to clipboard

Common types for HTTP operations

Results 111 http-types issues
Sort by recently updated
recently updated
newest added

So I need good support for `Accept-Language` in a project I'm working on. I figured I'd give it a crack. I haven't implemented the header itself just yet. The implementation...

The following test passes: ```rust #[test] fn negotiate_tie() -> crate::Result { let mut accept = Accept::new(); accept.push(MediaTypeProposal::new(mime::HTML, Some(0.4))?); accept.push(MediaTypeProposal::new(mime::XML, Some(0.4))?); assert_eq!(accept.negotiate(&[mime::HTML, mime::XML])?, mime::XML); assert_eq!(accept.negotiate(&[mime::XML, mime::HTML])?, mime::HTML); Ok(()) } ``` `XML`...

bug
good first issue

Hello http-types dev. I'm facing a situation where `http_types/response.rs:L63` will throw out a panic. I'm well aware that this case is very impossible but I still often encounter it with...

bug

Because it doesn't, this does not compile: ```rust async fn get(addr: &str) -> anyhow::Result { // ... let resp = async_h1::connect(stream, req).await?; Ok(resp) } ``` It's not obvious what to...

Make all associated Request methods return a Result instead of Self and panicking. Change docs and doc-tests to reflect this, and remove manual parsing in doc-tests and unit tests Fixes...

semver-major

When using `anyhow` directly, you can add context to any fallible operation using the methods from the `anyhow::Context` trait, which is implemented for all result types whose error implements `std::error::Error`....

enhancement

Some of predefined text mime-types (such as `mime::HTML` and `mime::XML`) have `;charset=utf-8` parameter, but browsers' default `Accept` header does not. (See [List of default Accept values - HTTP | MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Content_negotiation/List_of_default_Accept_values)...

question

Other users than http-rs might want to use these types, but they cannot currently be constructed outside of this crate

Why not expose the `Headers::new` function? An example for a use case: Creating a new library that uses an HTTP client and will let the users set the headers

This is a tracking issue for typed headers. I looked over the [HTTP headers](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers) page and categorized which headers would need to be ported. There are probably some nuances in...