-
Notifications
You must be signed in to change notification settings - Fork 0
MayRest
MayRest is a wrapper around the standard dart http library, that generally simplifies calls.
It has some useful features like being able to set default headers, and a token, so that you don't have to specify them in every call.
This is the token that will be used when generating the headers for requests. If null, no Authorization header is sent.
These are the default headers added to every api call made. If you pass anything into the headers field of a call, these will be overridden. Defaults to:
static Map<String, String> defaultHeaders = {
'Content-Type': 'application/json',
'Accept': 'application/json'
};Disables the colors for the static MayRest Log object.
Makes a get request to url. If quiet, no logs will show. If noToken, regardless of if userToken is set, no auth token will be passed. headers passed will override defaultHeaders
Future<Response> post(String url, dynamic body, {bool quiet, bool noToken, Map<String, String>? headers})
Posts body to url. All other parameters behave the same as get
Models - Currently Empty