RequestHandler class

This is used to create HTTP requests.

Constructors

RequestHandler({String? baseUrl, AuthManager? authManager, HttpWorker<int>? worker, QueueManager<int>? requestQueueManager})

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

get<T>(String url, {Map<String, String>? params, Map<String, String>? header, bool auth = false, Parser<T>? parser}) Request<T>
Function to make a GET network request
initialise() Future
This function should be called before making any requests. It initialises the AuthManager and HttpWorker.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(String url, {Map<String, String>? params, Map<String, String>? header, Object? body, bool auth = false, Parser<T>? parser}) Request<T>
Function to make a POST network request
request<T>(String path, {RequestMethod method = RequestMethod.get, Map<String, String>? params, Map<String, String>? header, Object? body, bool auth = false, Parser<T>? parser, Map<String, Object?>? meta}) Request<T>
Function to make a network request and returns the Request Id and a Cancellable. The Cancellable contains the Future of the Response of the request, and a Cancellable.cancel method to cancel the ongoing request before it completes.
toString() String
A string representation of this object.
inherited

Operators

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