[][src]Trait http_sig::ClientRequestLike

pub trait ClientRequestLike {
    fn host(&self) -> Option<String>;
fn set_header(&mut self, header: HeaderName, value: HeaderValue);
fn header(&self, header: &Header) -> Option<HeaderValue>;
fn compute_digest(&mut self, digest: &dyn HttpDigest) -> Option<String>; }

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 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.

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 header(&self, header: &Header) -> Option<HeaderValue>

Returns an existing header on the request. This method must reflect changes made be the set_header method, with the possible exception of the Authorization header itself.

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.

Loading content...

Implementations on Foreign Types

impl ClientRequestLike for Request[src]

impl ClientRequestLike for Request[src]

Loading content...

Implementors

Loading content...