Struct gapi_grpc::google::cloud::tasks::v2beta3::HttpRequest[][src]

pub struct HttpRequest {
    pub url: String,
    pub http_method: i32,
    pub headers: HashMap<String, String>,
    pub body: Vec<u8>,
    pub authorization_header: Option<AuthorizationHeader>,
}

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:

System throttling happens because:

Fields

url: String

Required. The full url path that the request will be sent to.

This string must begin with either “http://” or “https://”. Some examples are: http://acme.com and https://acme.com/sales:8080. Cloud Tasks will encode some characters for safety and compatibility. The maximum allowed URL length is 2083 characters after encoding.

The Location header response from a redirect response [300 - 399] may be followed. The redirect is not counted as a separate attempt.

http_method: i32

The HTTP method to use for the request. The default is POST.

headers: HashMap<String, String>

HTTP request headers.

This map contains the header field names and values. Headers can be set when the [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask].

These headers represent a subset of the headers that will accompany the task’s HTTP request. Some HTTP request headers will be ignored or replaced.

A partial list of headers that will be ignored or replaced is:

Content-Type won’t be set by Cloud Tasks. You can explicitly set Content-Type to a media type when the [task is created][google.cloud.tasks.v2beta3.CloudTasks.CreateTask]. For example, Content-Type can be set to "application/octet-stream" or "application/json".

Headers which can have multiple values (according to RFC2616) can be specified using comma-separated values.

The size of the headers must be less than 80KB.

body: Vec<u8>

HTTP request body.

A request body is allowed only if the [HTTP method][google.cloud.tasks.v2beta3.HttpRequest.http_method] is POST, PUT, or PATCH. It is an error to set body on a task with an incompatible [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod].

authorization_header: Option<AuthorizationHeader>

The mode for generating an Authorization header for HTTP requests.

If specified, all Authorization headers in the [HttpRequest.headers][google.cloud.tasks.v2beta3.HttpRequest.headers] field will be overridden.

Implementations

impl HttpRequest[src]

pub fn http_method(&self) -> HttpMethod[src]

Returns the enum value of http_method, or the default if the field is set to an invalid enum value.

pub fn set_http_method(&mut self, value: HttpMethod)[src]

Sets http_method to the provided enum value.

Trait Implementations

impl Clone for HttpRequest[src]

impl Debug for HttpRequest[src]

impl Default for HttpRequest[src]

impl Message for HttpRequest[src]

impl PartialEq<HttpRequest> for HttpRequest[src]

impl StructuralPartialEq for HttpRequest[src]

Auto Trait Implementations

impl RefUnwindSafe for HttpRequest

impl Send for HttpRequest

impl Sync for HttpRequest

impl Unpin for HttpRequest

impl UnwindSafe for HttpRequest

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 
[src]

impl<T> WithSubscriber for T[src]