Makes a POST request to an API endpoint with automatic retry on failure.
Implements exponential backoff and respects retry-after headers.
post_to_api(
url,
headers,
body,
max_retries = 2,
initial_delay_ms = 2000,
backoff_factor = 2
)The parsed JSON response.
The API endpoint URL.
A named list of HTTP headers.
The request body (will be converted to JSON).
Maximum number of retries (default: 2).
Initial delay in milliseconds (default: 2000).
Multiplier for delay on each retry (default: 2).