-
Notifications
You must be signed in to change notification settings - Fork 21
Open
Description
The documentation strongly suggests that the content-type is set to JSON, but this doesn't happen anywhere!
We're using the following middleware … but it would be nice if it was included by default.
pub struct ContentTypeMiddleware;
impl MiddleWare for ContentTypeMiddleware {
fn request<E>(
&self,
_: &E,
req: &mut http::request::Request<Vec<u8>>,
) -> Result<(), ClientError>
where
E: Endpoint,
{
req.headers_mut()
.append("content-type", HeaderValue::from_static("application/json"));
Ok(())
}
fn response<E>(
&self,
_: &E,
_: &mut http::response::Response<Vec<u8>>,
) -> Result<(), ClientError>
where
E: Endpoint,
{
Ok(())
}
}Would you be open to a PR adding this default behaviour?
GiveMeFox
Metadata
Metadata
Assignees
Labels
No labels