Method class

Implementers

Constructors

Method({String method = 'GET', dynamic uri, Map<String, String> headers = const {}, Map<String, String> authHeaders = const {}, List<ClientCookie> cookies = const [], List<Before> before = const [], List<After> after = const [], Map<String, dynamic> metadata = const {}, BaseClient? client})

Properties

getAfter List<After>
final
getAuthHeaders Map<String, String>
final
getBefore List<Before>
final
getClient ↔ BaseClient?
getter/setter pair
getCookies List<ClientCookie>
final
getHeaders Map<String, String>
final
getMetadata Map<String, dynamic>
final
hashCode int
The hash code for this object.
no setterinherited
method String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uri MutUri
getter/setter pair

Methods

after(After interceptor) Method
authHeader(String scheme, String credentials) Method
authToken(String credentials) Method
basicAuth(String username, String password) Method
before(Before interceptor) Method
charset(String charset) Method
clone() Method
contentType(String mimeType, String charset) Method
cookies(List<ClientCookie> cookie) Method
exact({int? statusCode, String? body, List<int>? bytes, String? mimeType, String? encoding, Map<String, String>? headers, int? contentLength, Map<String, dynamic> pathParams = const {}}) Future<Response>
expect(List<Checker<Response>> conditions, {Map<String, dynamic> pathParams = const {}}) Future<Response>
go({ResponseHook? onSuccess, ResponseHook? onFailure, bool throwOnErr = false, Map<String, dynamic> pathParams = const {}}) Future<Response>
Add headers
headers(Map<String, String> values) Method
Add headers
hookHeader(String key, ValueCallback<String?> getter) Method
http(String origin, [String? path]) Method
https(String origin, [String? path]) Method
metadata(Map<String, dynamic> value) Method
mimeType(String mimeType) Method
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
origin(String origin, [String? path]) Method
Set origin of the URL
path(String path) Method
Append path segments to the URL
pathParam(String name, dynamic value) Method
pathParams(Map<String, dynamic> pathParams) Method
queries(Map<String, dynamic> value) Method
Add query parameters
query(String key, dynamic value) Method
Add query parameters
readBytes({Map<String, dynamic> pathParams = const {}, FutureOr onError(Response resp)?}) Future<List<int>?>
readList<T>({T convert(Map d)?, Map<String, dynamic> pathParams = const {}, FutureOr onError(Response resp)?}) Future<List<T>?>
Fetches json response and returns the decoded result
readOne<T>({T convert(Map d)?, Map<String, dynamic> pathParams = const {}, FutureOr onError(Response resp)?}) Future<T?>
Fetches json response and returns the decoded result
readString({Map<String, dynamic> pathParams = const {}, FutureOr onError(Response resp)?}) Future<String?>
toString() String
A string representation of this object.
inherited
url(String value) Method
withClient(BaseClient client) Method
Set the client used to make HTTP requests

Operators

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