Struct webmachine_rust::context::WebmachineRequest
[−]
[src]
pub struct WebmachineRequest { pub request_path: String, pub base_path: String, pub method: String, pub headers: HashMap<String, Vec<HeaderValue>>, pub body: Option<String>, }
Request that the state machine is executing against
Fields
request_path: String
Path of the request relative to the resource
base_path: String
Resource base path
method: String
Request method
headers: HashMap<String, Vec<HeaderValue>>
Request headers
body: Option<String>
Request body
Methods
impl WebmachineRequest
[src]
fn default() -> WebmachineRequest
Creates a default request (GET /)
fn content_type(&self) -> String
returns the content type of the request, based on the content type header. Defaults to 'application/json' if there is no header.
fn is_put_or_post(&self) -> bool
If the request is a put or post
fn is_get_or_head(&self) -> bool
If the request is a get or head request
fn is_get(&self) -> bool
If the request is a get
fn is_options(&self) -> bool
If the request is an options
fn is_put(&self) -> bool
If the request is a put
fn is_post(&self) -> bool
If the request is a post
fn is_delete(&self) -> bool
If the request is a delete
fn has_accept_header(&self) -> bool
If an Accept header exists
fn accept(&self) -> Vec<HeaderValue>
Returns the acceptable media types from the Accept header
fn has_accept_language_header(&self) -> bool
If an Accept-Language header exists
fn accept_language(&self) -> Vec<HeaderValue>
Returns the acceptable languages from the Accept-Language header
fn has_accept_charset_header(&self) -> bool
If an Accept-Charset header exists
fn accept_charset(&self) -> Vec<HeaderValue>
Returns the acceptable charsets from the Accept-Charset header
fn has_accept_encoding_header(&self) -> bool
If an Accept-Encoding header exists
fn accept_encoding(&self) -> Vec<HeaderValue>
Returns the acceptable encodings from the Accept-Encoding header
fn has_header(&self, header: &String) -> bool
If the request has the provided header
fn find_header(&self, header: &String) -> Vec<HeaderValue>
Returns the list of values for the provided request header. If the header is not present, or has no value, and empty vector is returned.
fn has_header_value(&self, header: &String, value: &String) -> bool
If the header has a matching value
Trait Implementations
impl Debug for WebmachineRequest
[src]
impl Clone for WebmachineRequest
[src]
fn clone(&self) -> WebmachineRequest
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for WebmachineRequest
[src]
fn eq(&self, __arg_0: &WebmachineRequest) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &WebmachineRequest) -> bool
This method tests for !=
.