Struct rusoto_core::signature::SignedRequest [−][src]
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]
impl SignedRequest
pub fn new(
method: &str,
service: &str,
region: &Region,
path: &str
) -> SignedRequest
[src]
pub fn new(
method: &str,
service: &str,
region: &Region,
path: &str
) -> SignedRequest
Default constructor
pub fn set_content_type(&mut self, content_type: String)
[src]
pub fn set_content_type(&mut self, content_type: String)
Sets the value of the "content-type" header.
pub fn set_hostname(&mut self, hostname: Option<String>)
[src]
pub fn set_hostname(&mut self, hostname: Option<String>)
Sets the target hostname
pub fn set_endpoint_prefix(&mut self, endpoint_prefix: String)
[src]
pub fn set_endpoint_prefix(&mut self, endpoint_prefix: String)
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(&mut self, payload: Option<Vec<u8>>)
[src]
pub fn set_payload(&mut self, payload: Option<Vec<u8>>)
Sets the new body (payload)
pub fn set_payload_stream(
&mut self,
len_hint: Option<usize>,
stream: Box<Stream<Item = Vec<u8>, Error = Error> + Send>
)
[src]
pub fn set_payload_stream(
&mut self,
len_hint: Option<usize>,
stream: Box<Stream<Item = Vec<u8>, Error = Error> + Send>
)
Sets the new body (payload) as a stream
pub fn set_content_md5_header(&mut self)
[src]
pub fn set_content_md5_header(&mut self)
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]
pub fn method(&self) -> &str
Returns the current HTTP method
pub fn path(&self) -> &str
[src]
pub fn path(&self) -> &str
Returns the current path
pub fn canonical_path(&self) -> String
[src]
pub fn canonical_path(&self) -> String
Invokes canonical_uri(path)
to return a canonical path
pub fn canonical_uri(&self) -> &str
[src]
pub fn canonical_uri(&self) -> &str
Returns the current canonical URI
pub fn canonical_query_string(&self) -> &str
[src]
pub fn canonical_query_string(&self) -> &str
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]
pub fn headers(&self) -> &BTreeMap<String, Vec<Vec<u8>>>
Returns the current headers
pub fn scheme(&self) -> String
[src]
pub fn scheme(&self) -> String
Returns the current http scheme (https or http)
pub fn hostname(&self) -> String
[src]
pub fn hostname(&self) -> String
Converts hostname to String if it exists, else it invokes build_hostname()
pub fn remove_header(&mut self, key: &str)
[src]
pub fn remove_header(&mut self, key: &str)
If the key exists in headers, set it to blank/unoccupied:
pub fn add_header<K: ToString>(&mut self, key: K, value: &str)
[src]
pub fn add_header<K: ToString>(&mut self, key: K, value: &str)
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]
pub fn add_param<S>(&mut self, key: S, value: S) where
S: Into<String>,
Adds parameter to the HTTP Request
pub fn set_params(&mut self, params: Params)
[src]
pub fn set_params(&mut self, params: Params)
Sets paramaters with a given variable of Params
type
pub fn generate_presigned_url(&mut self, creds: &AwsCredentials) -> String
[src]
pub fn generate_presigned_url(&mut self, creds: &AwsCredentials) -> String
http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-query-string-auth.html
pub fn sign(&mut self, creds: &AwsCredentials)
[src]
pub fn sign(&mut self, creds: &AwsCredentials)
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]
pub fn sign_with_plus(
&mut self,
creds: &AwsCredentials,
should_treat_plus_literally: bool
)
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]
impl Debug for SignedRequest
Auto Trait Implementations
impl Send for SignedRequest
impl Send for SignedRequest
impl !Sync for SignedRequest
impl !Sync for SignedRequest