RequestContext class

A convenience wrapper around an incoming HTTP request.

Implemented by

Constructors

RequestContext()

Properties

acceptsAll bool
Returns as true if the client's Accept header indicates that it will accept any response content type.
read-only
app Angel
The Angel instance that is responding to this request.
read / write
body Map
All post data submitted to the server. [...]
read-only
contentType ContentType
The content type of an incoming request.
read-only
cookies List<Cookie>
Any cookies sent with this request.
read-only
extension String
Returns the file extension of the requested path, if any. [...]
read-only
files List<FileUploadInfo>
Any and all files sent to the server with this request. [...]
read-only
headers HttpHeaders
All HTTP headers sent with this request.
read-only
hostname String
The requested hostname.
read-only
injections Map
A Map of singletons injected via inject.
read-only
io HttpRequest
This feature does not map to other adapters (i.e. HTTP/2), so it will be removed in a future version.
read-only
ip String
The user's IP.
read-only
method String
This request's HTTP method. [...]
read-only
originalBuffer List<int>
The original body bytes sent with this request. May be empty. [...]
read-only
originalMethod String
The original HTTP verb sent to the server.
read-only
params Map
The URL parameters extracted from the request URI.
read / write
path String
The requested path.
read-only
properties Map
final
query Map
The parsed request query string. [...]
read-only
remoteAddress InternetAddress
The remote address requesting this resource.
read-only
serviceParams Map
Additional params to be passed to services.
final
session HttpSession
The user's HTTP session.
read-only
uri Uri
The Uri instance representing the path this request is responding to.
read-only
xhr bool
Is this an XMLHttpRequest?
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

accepts(dynamic contentType, { bool strict: false }) bool
Returns true if the client's Accept header indicates that the given contentType is considered a valid response. [...]
close() Future
Disposes of all resources.
grab<T>(dynamic key) → T
Grabs an object by key or type from params, _injections, or app.container. Use this to perform dependency injection within a service hook.
inject(dynamic type, dynamic value) → void
Shorthand to add to _injections.
lazyBody() Future<Map>
Retrieves the request body if it has already been parsed, or lazy-parses it before returning the body.
lazyFiles() Future<List<FileUploadInfo>>
Retrieves the request files if it has already been parsed, or lazy-parses it before returning the files.
lazyOriginalBuffer() Future<List<int>>
Retrieves the original request buffer if it has already been parsed, or lazy-parses it before returning the files. [...]
lazyQuery({bool forceParse: false }) Future<Map<String, dynamic>>
Retrieves the request body if it has already been parsed, or lazy-parses it before returning the query. [...]
parse() Future<BodyParseResult>
Manually parses the request body, if it has not already been parsed.
parseOnce() Future<BodyParseResult>
Override this method to one-time parse an incoming request.
@virtual
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited