Retry & Timeout
Retry & Timeout
Section titled “Retry & Timeout”@retry — Automatic Retries
Section titled “@retry — Automatic Retries”Automatically retry a request when it fails with a 5xx server error.
Basic Retry
Section titled “Basic Retry”@retry 3@name Flaky EndpointGET {{baseUrl}}/unstable-endpointThis retries up to 3 times on 5xx errors.
Retry with Delay
Section titled “Retry with Delay”Add a delay (in milliseconds) between retries:
@retry 5 delay 1000@name Critical PaymentPOST {{baseUrl}}/paymentContent-Type: application/json
{ "amount": 99.99}This retries up to 5 times, waiting 1 second between each attempt.
@timeout — Request Timeout
Section titled “@timeout — Request Timeout”Set a maximum time (in milliseconds) for a request to complete:
@timeout 5000@name Slow ReportGET {{baseUrl}}/heavy-reportIf the request takes longer than 5 seconds, it will be aborted.
Combining with @config
Section titled “Combining with @config”You can set default retry and timeout values in @config:
@configtimeout: 5000retries: 2
###@name Normal RequestGET {{baseUrl}}/users
###@timeout 30000@name Very Slow RequestGET {{baseUrl}}/exportThe first request uses the config defaults (5s timeout, 2 retries). The second overrides the timeout to 30 seconds.
Next Steps
Section titled “Next Steps”- See a complete example with all features combined
- Return to introduction