HttpService class

Constructors

HttpService({Client? client, bool? ownsClient, Config? config, AuthTokenProvider? tokenProvider, Duration timeout = defaultTimeout, Duration uploadTimeout = defaultUploadTimeout})
Every dependency is injectable so the transport can be exercised without a server. client also lets an application supply its own - one with certificate pinning, a proxy, or request logging.

Properties

config Config
final
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
Releases the client, if this service created it.
delete(String url, {HttpOptions? options}) Future
get(String url, {HttpOptions? options}) Future
getHeaders(HttpOptions? options, {bool isFile = false}) Future<Map<String, String>>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(String url, Map<String, dynamic> body, {HttpOptions? options}) Future
post(String url, dynamic body, {HttpOptions? options}) Future
postFile(String url, File file, {HttpOptions? options}) Future<Response>
put(String url, Map<String, dynamic> body, {HttpOptions? options}) Future
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

handleResponse(Response response) → dynamic

Constants

defaultTimeout → const Duration
How long a request may take before it is abandoned.
defaultUploadTimeout → const Duration
The same, for a file upload.