pub struct Request {
pub method: Method,
pub url: String,
pub body: Option<Value>,
pub hydra: Hydra,
pub extra_headers: Vec<(String, String)>,
pub refreshable: bool,
}Expand description
A prepared request the client will send if its URL is allowlisted.
Fields§
§method: Method§url: String§body: Option<Value>§hydra: Hydra§extra_headers: Vec<(String, String)>Extra per-request headers (e.g. food-web-ua).
refreshable: boolWhether the client may auto-refresh the session and retry this request once on a 401. False for non-idempotent calls like order submission.
Implementations§
Source§impl Request
impl Request
pub fn get(url: impl Into<String>, hydra: Hydra) -> Self
pub fn post(url: impl Into<String>, body: Value, hydra: Hydra) -> Self
Sourcepub fn no_refresh(self) -> Self
pub fn no_refresh(self) -> Self
Mark this request as non-retryable: the client will neither auto-refresh nor resend it on a 401 (use for order submission — no idempotency key).
Auto Trait Implementations§
impl Forget for Request
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