[][src]Struct rusoto_core::signature::SignedRequest

pub struct SignedRequest {
    pub method: String,
    pub service: String,
    pub region: Region,
    pub path: String,
    pub headers: BTreeMap<String, Vec<Vec<u8>>>,
    pub params: Params,
    pub scheme: Option<String>,
    pub hostname: Option<String>,
    pub payload: Option<SignedRequestPayload>,
    pub canonical_query_string: String,
    pub canonical_uri: String,
}

A data structure for all the elements of an HTTP request that are involved in the Amazon Signature Version 4 signing process

Fields

method: String

The HTTP Method

service: String

The AWS Service

region: Region

The AWS Region

path: String

The HTTP request path

headers: BTreeMap<String, Vec<Vec<u8>>>

The HTTP Request Headers

params: Params

The HTTP request paramaters

scheme: Option<String>

The HTTP/HTTPS protocol

hostname: Option<String>

The AWS hostname

payload: Option<SignedRequestPayload>

The HTTP Content

canonical_query_string: String

The Standardised query string

canonical_uri: String

The Standardised URI

Methods

impl SignedRequest[src]

pub fn new(
    method: &str,
    service: &str,
    region: &Region,
    path: &str
) -> SignedRequest
[src]

Default constructor

pub fn set_content_type(&mut self, content_type: String)[src]

Sets the value of the "content-type" header.

pub fn set_hostname(&mut self, hostname: Option<String>)[src]

Sets the target hostname

pub fn set_endpoint_prefix(&mut self, endpoint_prefix: String)[src]

Sets the target hostname using the current service type and region

See the implementation of build_hostname to see how this is done

pub fn set_payload<B: Into<Bytes>>(&mut self, payload: Option<B>)[src]

Sets the new body (payload)

pub fn set_payload_stream(&mut self, stream: ByteStream)[src]

Sets the new body (payload) as a stream

pub fn set_content_md5_header(&mut self)[src]

Computes and sets the Content-MD5 header based on the current payload.

Has no effect if the payload is not set, or is not a buffer.

pub fn method(&self) -> &str[src]

Returns the current HTTP method

pub fn path(&self) -> &str[src]

Returns the current path

pub fn canonical_path(&self) -> String[src]

Invokes canonical_uri(path) to return a canonical path

pub fn canonical_uri(&self) -> &str[src]

Returns the current canonical URI

pub fn canonical_query_string(&self) -> &str[src]

Returns the current query string

Converts a paramater such as "example param": "examplekey" into "&example+param=examplekey"

pub fn headers(&self) -> &BTreeMap<String, Vec<Vec<u8>>>[src]

Returns the current headers

pub fn scheme(&self) -> String[src]

Returns the current http scheme (https or http)

pub fn hostname(&self) -> String[src]

Converts hostname to String if it exists, else it invokes build_hostname()

pub fn remove_header(&mut self, key: &str)[src]

If the key exists in headers, set it to blank/unoccupied:

pub fn add_header<K: ToString>(&mut self, key: K, value: &str)[src]

Add a value to the array of headers for the specified key. Headers are kept sorted by key name for use at signing (BTreeMap)

pub fn add_param<S>(&mut self, key: S, value: S) where
    S: Into<String>, 
[src]

Adds parameter to the HTTP Request

pub fn set_params(&mut self, params: Params)[src]

Sets paramaters with a given variable of Params type

pub fn generate_presigned_url(
    &mut self,
    creds: &AwsCredentials,
    expires_in: &Duration,
    should_sha256_sign_payload: bool
) -> String
[src]

Generate a Presigned URL for AWS

See the documentation for more information.

pub fn sign(&mut self, creds: &AwsCredentials)[src]

Signs the request using Amazon Signature version 4 to verify identity. Authorization header uses AWS4-HMAC-SHA256 for signing.

pub fn sign_with_plus(
    &mut self,
    creds: &AwsCredentials,
    should_treat_plus_literally: bool
)
[src]

Signs the request using Amazon Signature version 4 to verify identity. Authorization header uses AWS4-HMAC-SHA256 for signing.

Trait Implementations

impl Debug for SignedRequest[src]

Auto Trait Implementations

impl Send for SignedRequest

impl !Sync for SignedRequest

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T

impl<T> Same for T

type Output = T

Should always be Self