HttpRequest class final
Represents an Http request.
Constructors
-
HttpRequest({required String method, required Host host, required String path, required Duration timeout, Map<
String, dynamic> ? headers, dynamic body, required Map<String, dynamic> queryParameters}) -
Constructs an HttpRequest instance with the provided parameters.
const
Properties
- body → dynamic
-
Body of the request. Can be any object which can be serialized to JSON.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
-
headers
→ Map<
String, dynamic> ? -
Headers to be included in the request. Can be null if no headers are needed.
final
- host → Host
-
The host to which the request will be sent.
final
- method → String
-
HTTP method of the request, such as "GET", "POST", etc.
final
- path → String
-
Path of the request on the host.
final
-
queryParameters
→ Map<
String, dynamic> -
Query parameters to be included in the request URL.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration
-
Maximum duration before the request is automatically cancelled.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override