DoxRequest class

Implemented types

Constructors

DoxRequest({required RouteData route, required Uri uri, required Map<String, dynamic> body, ContentType? contentType, String? clientIp, String scheme = 'http', required HttpHeaders httpHeaders, required HttpRequest httpRequest, RequestBody? requestBody, bool readClient = false})

Properties

auth → IAuth?
get auth class
no setteroverride
body ↔ Map<String, dynamic>
getter/setter pair
clientIp → String?
no setter
contentType → ContentType?
final
hashCode → int
The hash code for this object.
no setterinherited
headers → Map<String, dynamic>
Get all headers value
no setteroverride
httpHeaders → HttpHeaders
final
httpRequest → HttpRequest
final
locale → String?
The first language of the Accept-Language header, like th. null when there is none.
no setter
method ↔ String
getter/setter pairoverride
param ↔ Map<String, dynamic>
getter/setter pair
pathParams → Map<String, String>
The path params as text, like {'id': '5'}.
no setter
query ↔ Map<String, dynamic>
the query string, read on first use
getter/setter pair
requestBody → RequestBody
The body as it was read, for DTOs. body is its map.
final
route → RouteData
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
uri ↔ Uri
getter/setter pairoverride

Methods

add(String key, dynamic value) → void
Add new request value
override
all() → Map<String, dynamic>
Get all request from body and query
override
get cookie value from header
override
getRouteData() → RouteData
get route identifier
override
getRouteIdentifier() → String
get route identifier
override
has(String key) → bool
Check if input is present
override
Get header value
override
host() → String
get host|domain
override
input(String key) → dynamic
Get request value
override
ip() → String
Get user IP
override
isFormData() → bool
http request data is form data
override
isJson() → bool
http request data is json
override
isSecure() → bool
true when the client used https (see scheme)
merge(Map<String, dynamic> values) → void
Merge request values
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
only(List<String> keys) → Map<String, dynamic>
Get Only specific request from body and query
override
origin() → String?
get origin
override
referer() → String?
get referer
override
scheme() → String
http or https. Behind a proxy listed in trustedProxies this comes from X-Forwarded-Proto. Dart itself only serves plain http.
toJson() → Map<String, dynamic>
To support jsonEncode
override
toString() → String
A string representation of this object.
inherited
userAgent() → String
get user agent from header
override
validate<T>({Source? source}) → Future<T>
Check the request with the DTO T and give the typed object. Throws the 422 ValidationException when the input is not valid. source wins over the source of the DTO.
validateSchema<O>(Schema<O> schema) → Future<O>
Check the request (query and body) with a fluent dox_validation schema and give its output. Only for input you know at runtime.

Operators

operator ==(Object other) → bool
The equality operator.
inherited