Request class Null safety

This message defines attributes for an HTTP request.

If the actual request is not an HTTP request, the runtime system should try to map the actual request to an equivalent HTTP request.


Request({Auth? auth, Map<String, String>? headers, String? host, String? id, String? method, String? path, String? protocol, String? query, String? reason, String? scheme, String? size, String? time})
Request.fromJson(Map json_)


auth Auth?
The request authentication.
read / write
hashCode int
The hash code for this object.
headers Map<String, String>?
The HTTP request headers.
read / write
host String?
The HTTP request Host header value.
read / write
id String?
The unique ID for a request, which can be propagated to downstream systems.
read / write
method String?
The HTTP request method, such as GET, POST.
read / write
path String?
The HTTP URL path, excluding the query parameters.
read / write
protocol String?
The network protocol used with the request, such as "http/1.1", "spdy/3", "h2", "h2c", "webrtc", "tcp", "udp", "quic".
read / write
query String?
The HTTP URL query in the format of name1=value1&name2=value2, as it appears in the first line of the HTTP request.
read / write
reason String?
A special parameter for request reason.
read / write
runtimeType Type
A representation of the runtime type of the object.
scheme String?
The HTTP URL scheme, such as http and https.
read / write
size String?
The HTTP request size in bytes.
read / write
time String?
The timestamp when the destination service receives the last byte of the request.
read / write


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toJson() Map<String, dynamic>
toString() String
A string representation of this object.


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