HttpClient class
Basic http client implementation
- Inheritance
-
- Object
- HttpClientBase
- HttpClient
Constructors
-
HttpClient({Map<
String, String> defaultHeaders = const {}, AuthInterceptor? authInterceptor, bool persistentConnection = true})
Properties
- authInterceptor → AuthInterceptor?
-
Interceptor used to authenticate request if needed
finalinherited
-
defaultHeaders
→ Map<
String, String> -
Default headers sent to every http requests
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- persistentConnection → bool
-
Whether a persistent connection should be maintained with the server.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
processResponse(
HttpResponse response) → Future< HttpResponse> -
method used to process http
responsebefore return Can be used to map statusCode to exception for exempleoverride -
request(
{required HttpMethod method, required String path, required String endpoint, required RequestParameters requestParameters, bool authenticate = false, bool isMultipart = false, bool log = true}) → Future< HttpResponse> -
Method called to execute request
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
buildUri(
{required String endpoint, required String path, required RequestParameters params}) → Uri -
Map HttpClient.buildUri to HttpClientBase.buildUri
override