NodeFetchAdapter class
A Dio HttpClientAdapter that delegates HTTP requests to Node.js's
built-in globalThis.fetch via dart:js_interop.
Motivation: on Node.js, Dio's default adapter (chosen at compile time via
dart.library.js_interop) is the browser adapter, which relies on
XMLHttpRequest. Node has no XHR, so requests trap with "unreachable"
under dart2wasm or throw at runtime under dart2js. Modern Node (>= 18)
ships a built-in fetch implementation; this adapter routes Dio's SOAP
POSTs through it.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
{bool force = false}) → void - Close the current adapter and its inner clients or requests.
-
fetch(
RequestOptions options, Stream< Uint8List> ? requestStream, Future<void> ? cancelFuture) → Future<ResponseBody> - Implement this method to make real HTTP requests.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited