HttpRequest class
HTTP request.
The task will be pushed to the worker as an HTTP request. If the worker or
the redirected worker acknowledges the task by returning a successful HTTP
response code ([200
- 299
]), the task will be removed from the queue.
If any other HTTP response code is returned or no response is received, the
task will be retried according to the following: * User-specified
throttling: retry configuration, rate limits, and the queue's state. *
System throttling: To prevent the worker from overloading, Cloud Tasks may
temporarily reduce the queue's effective rate. User-specified settings will
not be changed. System throttling happens because: * Cloud Tasks backs off
on all errors. Normally the backoff specified in rate limits will be used.
But if the worker returns 429
(Too Many Requests), 503
(Service
Unavailable), or the rate of errors is high, Cloud Tasks will use a higher
backoff rate. The retry specified in the Retry-After
HTTP response header
is considered. * To prevent traffic spikes and to smooth sudden increases in
traffic, dispatches ramp up slowly when the queue is newly created or idle
and if large numbers of tasks suddenly become available to dispatch (due to
spikes in create task rates, the queue being unpaused, or many tasks that
are scheduled at the same time).
Constructors
-
HttpRequest({String? body, Map<
String, String> ? headers, String? httpMethod, OAuthToken? oauthToken, OidcToken? oidcToken, String? url}) - HttpRequest.fromJson(Map json_)
Properties
- body ↔ String?
-
HTTP request body.
getter/setter pair
-
bodyAsBytes
↔ List<
int> -
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
↔ Map<
String, String> ? -
HTTP request headers.
getter/setter pair
- httpMethod ↔ String?
-
The HTTP method to use for the request.
getter/setter pair
- oauthToken ↔ OAuthToken?
-
If specified, an
OAuth token
will be generated and attached as an
Authorization
header in the HTTP request.getter/setter pair - oidcToken ↔ OidcToken?
-
If specified, an
OIDC
token will be generated and attached as an
Authorization
header in the HTTP request.getter/setter pair - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url ↔ String?
-
The full url path that the request will be sent to.
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited