pub trait HttpRequestBody {
// Required method
fn to_vec(&self) -> Result<Vec<u8>, Error>;
// Provided method
fn apply_headers(&self, _headers: &mut HeaderMap) { ... }
}
Expand description
Trait defined on every body type that can be used with crate::HttpRequest
.
Required Methods§
Provided Methods§
Sourcefn apply_headers(&self, _headers: &mut HeaderMap)
fn apply_headers(&self, _headers: &mut HeaderMap)
Apply the headers that this body requires for the request to be valid.
This will usually add a http::header::CONTENT_TYPE
header.