http_client_hoc081098 library
Support for doing something awesome.
More dartdocs go here.
Classes
- CancellationToken
- A token for controlling the cancellation of async operations. A single token can be used for multiple async operations.
- SimpleHttpClient
- TODO(docs)
- SimpleLogger
- The logger that logs request and response information.
- SimpleLoggingInterceptor
- An interceptor which logs request and response information.
Enums
- SimpleLogLevel
- The log level.
Extensions
-
GuardedByStreamExtension
on Stream<
T> - Provide guardedBy extension method on Stream.
- GuardFutureCancellationTokenExtension on CancellationToken
- Provide guardFuture extension method on CancellationToken.
- GuardStreamCancellationTokenExtension on CancellationToken
- Provide guardStream extension method on CancellationToken.
- ResponseExtensions on Response
-
Provides isSuccessful extension methods on
http.Response.
Functions
-
useCancellationToken<
T> (Future< T> block(CancellationToken cancelToken)) → Single<T> -
Returns a
Singlethat, when listening to it, calls ablockfunction you specify and then emits the value returned from that function.
Typedefs
- JsonDecoderFunction = dynamic Function(String source)
- A function used to parse the string and returns the resulting JSON object.
- JsonEncoderFunction = String Function(Object object)
- A function used to convert the object to a JSON string.
- LoggerFunction = void Function(String message)
- A function that accepts a message string and does something with it, such as logging it, ...
-
RequestInterceptor
= FutureOr<
BaseRequest> Function(BaseRequest request) - If one or more request interceptors are set, they will be called before the request is sent to allow for modification of the original request.
-
ResponseInterceptor
= FutureOr<
Response> Function(BaseRequest request, Response response) - Used to able to modify the response before it is returned to the caller.
Exceptions / Errors
- CancellationException
- A exception that is used to indicate that a CancellationToken was cancelled.
- SimpleErrorResponseException
- The exception thrown by SimpleHttpClient when the response status code is not in the 2xx range.
- SimpleHttpClientException
- Exception thrown by SimpleHttpClient.
- SimpleTimeoutException
- The exception thrown by SimpleHttpClient when the sending of a request and receiving of a response time-out.