HttpClient class abstract

The interface for HTTP clients that take care of maintaining persistent connections across multiple requests to the same server.

Annotations
  • @experimental

Constructors

HttpClient(Dio dio, {ConnectivityRequestRetrier? connectivityRequestRetrier})
Creates a new instance of adapted client version.
factory

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() → void
Closes the client and cleans up any resources associated with it.
delete<T>(Uri url, {Map<String, dynamic>? headers, Object? body}) Future<Response<T>>
Sends an HTTP DELETE request with the given headers and body to the given URL.
get<T>(Uri url, {Map<String, dynamic>? headers}) Future<Response<T>>
Sends an HTTP GET request with the given headers to the given URL.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch<T>(Uri url, {Map<String, dynamic>? headers, Object? body}) Future<Response<T>>
Sends an HTTP PATCH request with the given headers and body to the given URL.
post<T>(Uri url, {Map<String, dynamic>? headers, Object? body}) Future<Response<T>>
Sends an HTTP POST request with the given headers and body to the given URL.
put<T>(Uri url, {Map<String, dynamic>? headers, Object? body}) Future<Response<T>>
Sends an HTTP PUT request with the given headers and body to the given URL.
toString() String
A string representation of this object.
inherited

Operators

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