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

Path of the request relative to the resource

Resource base path

Request method

Request headers

Request body

Methods

impl WebmachineRequest
[src]

Creates a default request (GET /)

returns the content type of the request, based on the content type header. Defaults to 'application/json' if there is no header.

If the request is a put or post

If the request is a get or head request

If the request is a get

If the request is an options

If the request is a put

If the request is a post

If the request is a delete

If an Accept header exists

Returns the acceptable media types from the Accept header

If an Accept-Language header exists

Returns the acceptable languages from the Accept-Language header

If an Accept-Charset header exists

Returns the acceptable charsets from the Accept-Charset header

If an Accept-Encoding header exists

Returns the acceptable encodings from the Accept-Encoding header

If the request has the provided header

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.

If the header has a matching value

Trait Implementations

impl Debug for WebmachineRequest
[src]

Formats the value using the given formatter.

impl Clone for WebmachineRequest
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl PartialEq for WebmachineRequest
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.