pub struct Request { /* private fields */ }Expand description
An incoming HTTP request from the Cufflink platform.
The platform serializes the full request context (method, headers, body, tenant, service name, auth) into JSON and passes it to your handler.
Implementations§
Source§impl Request
impl Request
Sourcepub fn from_json(json: &str) -> Option<Self>
pub fn from_json(json: &str) -> Option<Self>
Parse a Request from the JSON the platform provides.
Sourcepub fn raw_body(&self) -> &[u8] ⓘ
pub fn raw_body(&self) -> &[u8] ⓘ
The raw, unparsed request body bytes as the caller sent them.
Use this when verifying webhook signatures that HMAC over the
original payload (Stripe, OpenPhone/Quo, etc.) — the parsed
body() is canonicalized by serde_json and will not byte-match
what the sender signed. Returns an empty slice when no body was
sent.
Trait Implementations§
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