Skip to main content

fetch_json

Function fetch_json 

Source
async fn fetch_json<T: DeserializeOwned>(
    client: &Client,
    url: &str,
    bearer: &str,
) -> Result<(T, Vec<u8>), OauthUsageError>
Expand description

One authenticated GET, classified like the window probes: 401 / 403 unauthorized, 429 rate-limited (honouring Retry-After), any other status carrying a truncated body suffix. Returns the decoded body alongside the raw bytes so a caller can name an unexpected 200 shape in its own log.