Struct worker_plus::RequestInit
source · 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§
source§impl RequestInit
impl RequestInit
pub fn new() -> Self
pub fn with_headers(&mut self, headers: Headers) -> &mut Self
pub fn with_method(&mut self, method: Method) -> &mut Self
pub fn with_redirect(&mut self, redirect: RequestRedirect) -> &mut Self
pub fn with_body(&mut self, body: Option<JsValue>) -> &mut Self
pub fn with_cf_properties(&mut self, props: CfProperties) -> &mut Self
Trait Implementations§
source§impl Default for RequestInit
impl Default for RequestInit
source§impl From<&RequestInit> for RequestInit
impl From<&RequestInit> for RequestInit
source§fn from(req: &RequestInit) -> Self
fn from(req: &RequestInit) -> Self
Converts to this type from the input type.