Struct worker::RequestInit[][src]

pub struct RequestInit {
    pub body: Option<JsValue>,
    pub headers: Headers,
    pub cf: CfProperties,
    pub method: Method,
    pub redirect: RequestRedirect,
}
Expand description

Optional options struct that contains settings to apply to the Request.

Fields

body: Option<JsValue>

Currently requires a manual conversion from your data into a wasm_bindgen::JsValue.

headers: Headers

Headers associated with the outbound Request.

cf: CfProperties

Cloudflare-specific properties that can be set on the Request that control how Cloudflare’s edge handles the request.

method: Method

The HTTP Method used for this Request.

redirect: RequestRedirect

The redirect mode to use: follow, error, or manual. The default for a new Request object is follow. Note, however, that the incoming Request property of a FetchEvent will have redirect mode manual.

Implementations

Trait Implementations

Returns the “default value” for a type. Read more

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.