Skip to main content

Module http

Module http 

Source
Expand description

HTTP client and request execution with rate limiting and finite retry HTTP client and request execution for the IG Markets API.

This module owns all outbound HTTP I/O: the shared reqwest client, rate limiting, finite retry with backoff, and the automatic token refresh-and-replay contract. It lives in the application layer because it depends on Auth, Session, Config and RateLimiter — the pure model layer must not perform I/O.

Structs§

HttpClient
Simplified client for IG Markets API with automatic authentication
Pacing
The two budgets every physical request has to pass.

Functions§

make_http_request
Makes an HTTP request with automatic rate limiting and retry on rate limit errors
make_http_request_paced
The one place a request is actually sent, and so the one place both budgets are charged.
make_http_request_reserved
Same as make_http_request, but told whether the first send already owns a token.
make_http_request_with_account
Same as make_http_request, but paced against a key budget and the account budget its keys share.