HTTPSClient class
An enhanced HTTP client with additional features like interceptors, automatic retries, and simplified API.
Constructors
- HTTPSClient({Client? client})
-
Creates an HTTPS client with an optional underlying
http.Client.
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
-
addInterceptor(
Interceptor interceptor) → void - Adds an interceptor to the client.
-
close(
) → void - Closes the client and frees up resources.
-
delete(
Object url, {Map< String, String> ? headers}) → Future<Response> -
Makes a DELETE request to the specified
url. Theurlcan be either a String or a Uri object. -
download(
Object url, String fileName, {Map< String, String> ? headers, void onProgress(int bytesReceived, int totalBytes)?}) → Future<String> -
Downloads a file from the specified
urlto a temporary location. Theurlcan be either a String or a Uri object. -
get(
Object url, {Map< String, String> ? headers}) → Future<Response> -
Makes a GET request to the specified
url. Theurlcan be either a String or a Uri object. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a PATCH request to the specified
url. Theurlcan be either a String or a Uri object. -
post(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a POST request to the specified
url. Theurlcan be either a String or a Uri object. -
put(
Object url, {Map< String, String> ? headers, Object? body, Encoding? encoding}) → Future<Response> -
Makes a PUT request to the specified
url. Theurlcan be either a String or a Uri object. -
removeInterceptor(
Interceptor interceptor) → void - Removes an interceptor from the client.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited