Struct micro_http_async::Request
source ·
[−]pub struct Request {
pub method: Option<HttpMethod>,
pub uri: String,
pub user_agent: String,
pub user_addr: SocketAddr,
pub get_request: HashMap<String, String>,
pub post_request: HashMap<String, PostRequest>,
pub raw_request: Vec<String>,
pub secure: bool,
}
Expand description
Request
Handles requests from users, and returns it in a friendly, safe way.
Can be used to gather POST and GET info, user-agent information and more
If you have custom headers, and want to access them, use raw_request
to access the
raw unmodified request
Fields
method: Option<HttpMethod>
Method stores the method used to make the request
uri: String
URI contains the URI of the request
user_agent: String
User Agent stores the user agent of the user
user_addr: SocketAddr
User Addr stores the users IP address
get_request: HashMap<String, String>
Get Request stores the data of the get request.
It is a HashMap<String, String>
The key of the hashmap is equal to the name of the form field name.
post_request: HashMap<String, PostRequest>
Post Request stores the data of the post request.
It is a HashMap<String, PostRequest>
The key of the hashmap is equal to the name of the form field name.
raw_request: Vec<String>
Raw Request stores the raw request without any modifications.
secure: bool
Did the request come from a secure connection?