PendingRequest class final

A request being configured (Laravel's PendingRequest).

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

accept(String contentType) → PendingRequest
acceptJson() → PendingRequest
asForm() → PendingRequest
Sends json: maps as application/x-www-form-urlencoded.
asJson() → PendingRequest
Sends json: bodies as JSON (the default).
baseUrl(String url) → PendingRequest
delete(String url, {Object? json, Map<String, Object?>? query}) → Future<ClientResponse>
get(String url, {Map<String, Object?>? query}) → Future<ClientResponse>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
patch(String url, {Object? json, Map<String, String>? form, String? body}) → Future<ClientResponse>
post(String url, {Object? json, Map<String, String>? form, String? body}) → Future<ClientResponse>
put(String url, {Object? json, Map<String, String>? form, String? body}) → Future<ClientResponse>
retry(int times, {Duration delay = const Duration(milliseconds: 100), bool when(ClientResponse? response, Object? error)?}) → PendingRequest
Tries up to times times in total, waiting delay between tries, when the connection fails or the response is a client or server error (or when when says so). The last response is returned either way.
send(String method, String url, {Map<String, Object?>? query, Object? json, Map<String, String>? form, String? body}) → Future<ClientResponse>
Sends the request, retrying as configured.
timeout(Duration timeout) → PendingRequest
Fails a request (connect, send and read) after timeout; 30 s by default, as in Laravel.
toString() → String
A string representation of this object.
inherited
withBasicAuth(String username, String password) → PendingRequest
withHeaders(Map<String, String> headers) → PendingRequest
withToken(String token, {String type = 'Bearer'}) → PendingRequest
withUserAgent(String userAgent) → PendingRequest

Operators

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