pub type Request<T = Body> = Request<T>;
Expand description
Represents an HTTP Request.
Aliased Type§
struct Request<T = Body> { /* private fields */ }
Trait Implementations§
source§impl RequestExt for Request
impl RequestExt for Request
source§fn query_string(&self) -> Option<&str>
fn query_string(&self) -> Option<&str>
Get URL’s query string of this request.
source§fn query<T>(&self) -> Result<T, PayloadError>where
T: DeserializeOwned,
fn query<T>(&self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
query
only.Get query data by type. Read more
source§fn header<K, T>(&self, key: K) -> Option<T>where
K: AsHeaderName,
T: FromStr,
fn header<K, T>(&self, key: K) -> Option<T>where
K: AsHeaderName,
T: FromStr,
Get a header with the key.
source§fn header_typed<H>(&self) -> Option<H>where
H: Header,
fn header_typed<H>(&self) -> Option<H>where
H: Header,
Get a header with the specified type.
source§fn content_length(&self) -> Option<u64>
fn content_length(&self) -> Option<u64>
Get the size of this request’s body.
source§fn content_type(&self) -> Option<Mime>
fn content_type(&self) -> Option<Mime>
Get the media type of this request.
source§async fn extract<T>(&mut self) -> Result<T, T::Error>where
T: FromRequest,
async fn extract<T>(&mut self) -> Result<T, T::Error>where
T: FromRequest,
Extract the data from this request by the specified type.
source§async fn bytes(&mut self) -> Result<Bytes, PayloadError>
async fn bytes(&mut self) -> Result<Bytes, PayloadError>
Return with a Bytes representation of the request body.
source§async fn text(&mut self) -> Result<String, PayloadError>
async fn text(&mut self) -> Result<String, PayloadError>
Return with a Text representation of the request body.
source§async fn form<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn form<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
form
only.Return with a
application/x-www-form-urlencoded
FormData by the specified type
representation of the request body.source§async fn json<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn json<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
json
only.Return with a JSON by the specified type representation of the request body.
source§async fn multipart(&mut self) -> Result<Multipart, PayloadError>
async fn multipart(&mut self) -> Result<Multipart, PayloadError>
Available on crate feature
multipart
only.Return with a
multipart/form-data
FormData by the specified type
representation of the request body.source§fn state<T>(&self) -> Option<T>
fn state<T>(&self) -> Option<T>
Available on crate feature
state
only.Return a shared state by the specified type.
source§fn set_state<T>(&mut self, t: T) -> Option<T>
fn set_state<T>(&mut self, t: T) -> Option<T>
Available on crate feature
state
only.Store a shared state.
Available on crate feature
cookie
only.Get a cookie by the specified name.
source§fn params<T>(&self) -> Result<T, ParamsError>where
T: DeserializeOwned,
fn params<T>(&self) -> Result<T, ParamsError>where
T: DeserializeOwned,
Available on crate feature
params
only.Get all parameters. Read more
source§fn param<T>(&self, name: &str) -> Result<T, ParamsError>
fn param<T>(&self, name: &str) -> Result<T, ParamsError>
Available on crate feature
params
only.Get single parameter by name. Read more
source§fn remote_addr(&self) -> Option<&SocketAddr>
fn remote_addr(&self) -> Option<&SocketAddr>
Get remote addr.
source§fn route_info(&self) -> &Arc<RouteInfo>
fn route_info(&self) -> &Arc<RouteInfo>
Available on crate feature
params
only.Get current route.
source§impl RequestLimitsExt for Request
Available on crate feature limits
only.
impl RequestLimitsExt for Request
Available on crate feature
limits
only.source§async fn bytes_with(
&mut self,
limit: Option<u64>,
max: u64,
) -> Result<Bytes, PayloadError>
async fn bytes_with( &mut self, limit: Option<u64>, max: u64, ) -> Result<Bytes, PayloadError>
Return with a Bytes by a limit representation of the request body.
source§async fn text_with_limit(&mut self) -> Result<String, PayloadError>
async fn text_with_limit(&mut self) -> Result<String, PayloadError>
Return with a limited Text representation of the request body.
source§async fn form_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn form_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
form
only.Return with a limited
application/x-www-form-urlencoded
FormData by the specified type
representation of the request body.source§async fn json_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
async fn json_with_limit<T>(&mut self) -> Result<T, PayloadError>where
T: DeserializeOwned,
Available on crate feature
json
only.Return with a limited JSON by the specified type representation of the request body.
source§async fn multipart_with_limit(&mut self) -> Result<Multipart, PayloadError>
async fn multipart_with_limit(&mut self) -> Result<Multipart, PayloadError>
Available on crate feature
multipart
only.Return with a limited
multipart/form-data
FormData by the specified type
representation of the request body.