HttpFetcher class interface

A Fetcher implementation for accessing HTTP or HTTPS resources.

Implemented types
Mixed in types

Constructors

HttpFetcher.client(Client client, {List<Uri>? endpoints, HttpValidator validator = _validate200OK})
A HTTP fetcher using the given HTTP client and optional endpoints.
factory
HttpFetcher.custom({required HttpAdapter adapter, required UriResolver resolver, HttpValidator validator = _validate200OK})
A customized HTTP fetcher using the given adapter and resolver.
factory
HttpFetcher.simple({List<Uri>? endpoints, HttpValidator validator = _validate200OK})
A HTTP fetcher using optional endpoints.
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

fetch(Uri reference) Future<HttpContent>
Fetch (read fully) content body from a resource identified by reference.
override
fetchBytes(Uri reference) Future<Uint8List>
Fetch content body as bytes from a resource identified by reference.
inherited
fetchJson(Uri reference, {Object? reviver(Object? key, Object? value)?}) Future
Fetch content body as JSON data from a resource identified by reference.
inherited
fetchStream(Uri reference) Future<HttpContent>
Fetch content as a stream from a resource identified by reference.
override
fetchText(Uri reference) Future<String>
Fetch content body as text from a resource identified by reference.
inherited
headers(Map<String, String> headers) HttpFetcher
Returns a new controlled object of C with given headers applied to it.
override
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