Skip to main content

post_signed

Function post_signed 

Source
pub fn post_signed(
    url: &str,
    secret: &[u8],
    bearer: Option<&str>,
    body: &Value,
) -> impl Future<Output = Result<Answer>> + Send + use<>
Expand description

POSTs body as JSON to url, signed: the HMAC-SHA256 of the body with secret in X-Signature (lowercase hex, see sign), and Authorization: Bearer <bearer> when given (API keys of services such as RunPod). One subrequest. Any status is an answer: check status (a service’s 4xx is not an error of the call).

§Errors

Error::Internal when the request cannot be built or the service cannot be reached.