Skip to main content

make_http_request_paced

Function make_http_request_paced 

Source
pub async fn make_http_request_paced<B: Serialize>(
    client: &Client,
    pacing: Pacing<'_>,
    method: Method,
    url: &str,
    headers: Vec<(&str, &str)>,
    body: &Option<B>,
    retry_config: RetryConfig,
    reserved: bool,
) -> Result<Response, AppError>
Expand description

The one place a request is actually sent, and so the one place both budgets are charged.

reserved = true means the caller already holds this key’s token for the first send. The account budget is never pre-reserved: it is taken here, immediately before each send, so logins, refreshes and every retry pay it too.

§Errors

Same as make_http_request.