HttpRequest class
Immutable HTTP input. Copying retains the body and its replayability contract.
- Available extensions
Constructors
- HttpRequest({required Uri uri, HttpMethod method = HttpMethod.get, HttpHeaders? headers, RequestBody? body, Duration? timeout, RequestContext? context})
Properties
- body → RequestBody?
-
final
- context → RequestContext
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headers → HttpHeaders
-
final
- method → HttpMethod
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeout → Duration?
-
Overall deadline override, including middleware, retries, and body consumption.
Null inherits the client default. Enforced by HttpClientService.
final
- uri → Uri
-
final
Methods
-
copyWith(
{Uri? uri, HttpMethod? method, HttpHeaders? headers, RequestBody? body, bool removeBody = false, Duration? timeout, RequestContext? context}) → HttpRequest -
Copies selected values;
removeBodyexplicitly clears an existing body. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
withHeader(
String name, String value) → HttpRequest -
Available on HttpRequest, provided by the HttpRequestExtensions extension
-
withoutHeader(
String name) → HttpRequest -
Available on HttpRequest, provided by the HttpRequestExtensions extension
-
withQueryParameters(
Map< String, Object?> parameters) → HttpRequest -
Available on HttpRequest, provided by the HttpRequestExtensions extension
Replaces supplied keys, preserving other keys and repeated values.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited