pub struct Request {
pub method: Method,
pub url: String,
pub headers: BTreeMap<String, String>,
pub body: Option<RequestBody>,
pub output: ResponseOutput,
pub follow_redirects: bool,
pub timeout_ms: Option<u64>,
}Expand description
One HTTP request. The schemars descriptions are what a model reads when
the http package serves this as its input.
Fields§
§method: Method§url: String§headers: BTreeMap<String, String>Sent as given on the first hop. Connection-level headers such as
host and content-length are the worker’s own and are dropped, and
a header a credential sets for the hop’s origin is refused.
body: Option<RequestBody>§output: ResponseOutput§follow_redirects: boolUp to MAX_REDIRECTS hops, each checked like the first. A stored
credential rides only to its own origin; on a hop to another origin the
guest’s own authorization, cookie, and proxy-authorization headers are
dropped and the rest are sent as given.
timeout_ms: Option<u64>Bounds the whole request, every hop and the body included. The invocation’s own deadline bounds it regardless.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Request
impl<'de> Deserialize<'de> for Request
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Request
impl JsonSchema for Request
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Request
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin for Request
impl UnwindSafe for Request
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more