Struct ntex::web::WebRequest [−][src]
pub struct WebRequest<Err> { /* fields omitted */ }
Expand description
An service http request
WebRequest allows mutable access to request’s internal structures
Implementations
Create web response for error
Create web response for error
Deconstruct request into parts
Construct request from parts.
WebRequest
can be re-constructed only if req
hasnt been cloned.
Construct request from request.
HttpRequest
implements Clone
trait via Rc
type. WebRequest
can be re-constructed only if rc’s strong pointers count eq 1 and
weak pointers count is 0.
Create web response
This method returns reference to the request head
This method returns reference to the request head
Returns mutable request’s headers.
The query string in the URL.
E.g., id=10
Peer socket address
Peer address is actual socket address, if proxy is used in front of ntex http server, then peer address would be address of this proxy.
To get client connection information ConnectionInfo
should be used.
Get ConnectionInfo for the current request.
Get a reference to the Path parameters.
Params is a container for url parameters.
A variable segment is specified in the form {identifier}
,
where the identifier can be used later in a request handler to
access the matched value for that segment.
Get a mutable reference to the Path parameters.
Get a reference to a ResourceMap
of current application.
Service configuration
Get an application data stored with App::app_data()
method during
application configuration.
To get data stored with App::data()
use web::types::Data<T>
as type.
Get request’s payload
Set request payload.
Request extensions
Mutable reference to a the request’s extensions
Trait Implementations
Returns Request’s headers.
Request extensions
Mutable reference to a the request’s extensions
Read the request content type. If request does not contain Content-Type header, empty str get returned. Read more
Get content type encoding Read more
Convert the request content type to a known mime type.
Check if request has chunked transfer encoding
Load request cookies.
Return request cookie.
type Response = WebResponse
type Response = WebResponse
Responses given by the service
type Service = RouteService<Err>
type Service = RouteService<Err>
The Service
value created by this factory
Create and return a new service value asynchronously.
Map this service’s output to a different type, returning a new service of the resulting type. Read more
Map this service’s error to a different error, returning a new service.
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
F: Fn(Self::InitError) -> E + Clone,
fn map_init_err<F, E>(self, f: F) -> MapInitErr<Self, Req, Cfg, F, E> where
F: Fn(Self::InitError) -> E + Clone,
Map this factory’s init error to a different error, returning a new service.
Auto Trait Implementations
impl<Err> !RefUnwindSafe for WebRequest<Err>
impl<Err> !Send for WebRequest<Err>
impl<Err> !Sync for WebRequest<Err>
impl<Err> Unpin for WebRequest<Err> where
Err: Unpin,
impl<Err> !UnwindSafe for WebRequest<Err>
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more