Struct actix_web::HttpRequest
[−]
[src]
pub struct HttpRequest { /* fields omitted */ }
An HTTP Request
Methods
impl HttpRequest
[src]
fn new(
method: Method,
path: String,
version: Version,
headers: HeaderMap,
query: String
) -> Self
[src]
method: Method,
path: String,
version: Version,
headers: HeaderMap,
query: String
) -> Self
Construct a new Request.
fn extensions(&mut self) -> &mut Extensions
[src]
Protocol extensions.
fn method(&self) -> &Method
[src]
Read the Request method.
fn version(&self) -> Version
[src]
Read the Request Version.
fn headers(&self) -> &HeaderMap
[src]
Read the Request Headers.
fn path(&self) -> &str
[src]
The target path of this Request.
fn query(&self) -> HashMap<String, String>
[src]
Return a new iterator that yields pairs of Cow<str>
for query parameters
fn query_string(&self) -> &str
[src]
The query string in the URL.
E.g., id=10
[src]
Return request cookies.
[src]
Return request cookie.
[src]
Load cookies
fn match_info(&self) -> &Params
[src]
Get a reference to the Params object. Params is a container for url parameters. Route supports glob patterns: * for a single wildcard segment and :param for matching storing that segment of the request url in the Params object.
fn set_match_info(&mut self, params: Params)
[src]
Set request Params.
fn keep_alive(&self) -> bool
[src]
Checks if a connection should be kept alive.
fn content_type(&self) -> &str
[src]
Read the request content type
fn chunked(&self) -> Result<bool, ParseError>
[src]
Check if request has chunked transfer encoding
fn range(&self, size: u64) -> Result<Vec<HttpRange>, HttpRangeParseError>
[src]
Parses Range HTTP header string as per RFC 2616.
size
is full size of response (file).
fn multipart(&self, payload: Payload) -> Result<Multipart, MultipartError>
[src]
Return stream to process BODY as multipart.
Content-type: multipart/form-data;
fn urlencoded(&self, payload: Payload) -> Result<UrlEncoded, Payload>
[src]
Parse application/x-www-form-urlencoded
encoded body.
Return UrlEncoded
future. It resolves to a HashMap<String, String>
which
contains decoded parameters.
Returns error:
- content type is not
application/x-www-form-urlencoded
- transfer encoding is
chunked
. - content-length is greater than 256k