[−][src]Trait http_sig::ClientRequestLike
This trait is to be implemented for types representing an outgoing HTTP request. The HTTP signing extension methods are available on any type implementing this trait.
Required methods
fn set_header(&mut self, header: HeaderName, value: HeaderValue)
Add a header to the request. This function may be used to set the Date
and Digest
headers if not already present depending on the configuration. The Authorization
header will always be set assuming the message was signed successfully.
fn compute_digest(&mut self, digest: &dyn HttpDigest) -> Option<String>
Compute the digest using the provided HTTP digest algorithm. If this is not possible,
then return None
. This may require buffering the request data into memory.
Provided methods
fn host(&self) -> Option<String>
Returns the host for the request (eg. "example.com") in case the Host header has
not been set explicitly.
When implementing this trait, do not just read the Host
header from the request -
this method will only be called when the Host
header is not set.