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
nullfor requests without a body. -
buildOptions(
) → Options? -
Returns Dio
Optionsfor this request. -
headers(
) → Map< String, String> ? -
Returns headers specific to this request, or
nullfor 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
nullfor 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