Request class abstract

Abstract base class for a single HTTP request.

Subclass Request once per API endpoint. At minimum, implement method and resolveEndpoint. Override the optional hook methods to supply headers, query parameters, a body, or custom Dio options. Body mixins (e.g. HasJsonBody, HasFormBody) override body and buildOptions automatically.

Implementers

Constructors

Request()

Properties

hashCode → int
The hash code for this object.
no setterinherited
logRequest → bool
Whether the outgoing request should be passed to the logging interceptor.
no setter
logResponse → bool
Whether the incoming response should be passed to the logging interceptor.
no setter
method → String
The HTTP method for this request (e.g. 'GET', 'POST', 'PUT').
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
useAuth → bool?
Per-request authentication override.
no setter

Methods

body() → dynamic
Returns the request body, or null for requests without a body.
buildOptions() → Options?
Returns Dio Options for this request.
headers() → Map<String, String>?
Returns headers specific to this request, or null for none.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryParameters() → Map<String, dynamic>?
Returns query parameters specific to this request, or null for none.
resolveEndpoint() → String
Returns the endpoint path relative to the connector's base URL.
toString() → String
A string representation of this object.
inherited

Operators

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