JsonClient class

Constructors

JsonClient(Client client, {JsonRepo repo, bool manageCookie = false, String basePath})

Properties

basePath String
final
bearerAuthHeader String
read / write
client Client
The underlying http client used to make the requests
final
defaultHeaders Map<String, String>
final
hashCode int
The hash code for this object.
read-only, inherited
jar CookieJar
final
manageCookie bool
final
repo JsonRepo
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

authenticate(AuthPayload payload, {dynamic url = '/api/login', Map<String, String> headers, bool captureAuthToken = false, String reCaptchaResp, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Authenticates using JSON body
authenticateBasic(AuthPayload payload, {dynamic url = '/api/login', Map<String, String> headers, bool captureAuthToken = false, String reCaptchaResp, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Authenticates using Basic Authentication
authenticateForm(AuthPayload payload, {dynamic url = '/api/login', Map<String, String> headers, bool captureAuthToken = false, String reCaptchaResp, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Authenticates using url-encoded-form
delete(dynamic url, {Map<String, String> headers, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Issues a JSON DELETE request and returns decoded JSON response as JsonResponse
get(dynamic url, {Map<String, String> headers, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Issues a JSON GET request and returns decoded JSON response as JsonResponse
logout({dynamic url = '/api/logout', dynamic body, Map<String, String> headers, bool removeAuthToken = false, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
post(dynamic url, {Map<String, String> headers, dynamic body, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Issues a JSON POST request and returns decoded JSON response as JsonResponse
postForm(dynamic url, {Map<String, String> headers, dynamic body, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
put(dynamic url, {Map<String, String> headers, dynamic body, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Issues a JSON PUT request and returns decoded JSON response as JsonResponse
putForm(dynamic url, {Map<String, String> headers, dynamic body, List<Before> before = const [], List<After> after = const []}) AsyncJsonResponse
Issues a JSON PUT request with url-encoded-form body and returns decoded JSON response as JsonResponse
toString() String
A string representation of this object.
inherited

Operators

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

Constants

recapHeader → const String
'jaguar-recaptcha'