Error Code Atlas

429 Too Many Requests: Retry-After in 7 HTTP Clients

What happens to your request next?

With default settings, none of the measured clients sent the request again after a 429 in this measurement; the 429 came back to the calling code.

“The 429 status code indicates that the user has sent too many requests in a given amount of time ("rate limiting").” — RFC 6585 §4

Reading the measurements

Read the input, observation, and outcome columns together.

Measured on Linux (x86_64, kernel 7.0.0-34-generic) against a local test server over the loopback interface, with curl 8.18.0, GNU Wget 1.25.0, Python urllib.request 3.12.13, Python Requests 2.34.2, Python HTTPX 0.28.1, Node.js fetch 20.20.2, Chromium fetch() 149.0.7827.55 (urllib3 2.7.0 under Requests, httpcore 1.0.9 under HTTPX, undici 6.24.1 under Node.js), each run twice. Retry-After values of 2 and 4 seconds, dates 2 to 5 seconds ahead in the three HTTP-date formats, no header, and the invalid value “soon” were measured; longer waits, other invalid values, other versions and settings, Windows, macOS, Firefox and Safari were not measured.

Default settings, GET: what the server saw and what the calling code got (two runs, identical)
ClientRetry-After sentRequests seenResultCalling code got
curl 8.18.02 (seconds)1not sent again; the 429 came backstatus 429, exit code 0
curl 8.18.0IMF-fixdate1not sent again; the 429 came backstatus 429, exit code 0
curl 8.18.0no header1not sent again; the 429 came backstatus 429, exit code 0
GNU Wget 1.25.02 (seconds)1not sent again; the 429 came backexit code 8
GNU Wget 1.25.0IMF-fixdate1not sent again; the 429 came backexit code 8
GNU Wget 1.25.0no header1not sent again; the 429 came backexit code 8
Python urllib.request 3.12.132 (seconds)1not sent again; the 429 came backstatus 429 as HTTPError; Retry-After readable, same as sent
Python urllib.request 3.12.13IMF-fixdate1not sent again; the 429 came backstatus 429 as HTTPError; Retry-After readable, same as sent
Python urllib.request 3.12.13no header1not sent again; the 429 came backstatus 429 as HTTPError; no Retry-After to read
Python Requests 2.34.22 (seconds)1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Python Requests 2.34.2IMF-fixdate1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Python Requests 2.34.2no header1not sent again; the 429 came backstatus 429; no Retry-After to read
Python HTTPX 0.28.12 (seconds)1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Python HTTPX 0.28.1IMF-fixdate1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Python HTTPX 0.28.1no header1not sent again; the 429 came backstatus 429; no Retry-After to read
Node.js fetch 20.20.22 (seconds)1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Node.js fetch 20.20.2IMF-fixdate1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Node.js fetch 20.20.2no header1not sent again; the 429 came backstatus 429; no Retry-After to read
Chromium fetch() 149.0.7827.552 (seconds)1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Chromium fetch() 149.0.7827.55IMF-fixdate1not sent again; the 429 came backstatus 429; Retry-After readable, same as sent
Chromium fetch() 149.0.7827.55no header1not sent again; the 429 came backstatus 429; no Retry-After to read

Comparing the measured cases

Retries turned on: target wait, measured wait (two runs, rounded to 0.1 s) and result. Target band: seconds format N − 0.05 s to N + 1.0 s; date formats D − 1.0 s to D + 1.0 s, where D is the time from sending the 429 to the date it named. An HTTP date has one-second resolution, so a date-format retry up to one second earlier than the target was counted as inside the band.
Client and settingMethodRetry-After sentTargetMeasuredRepeated requestResult
curl 8.18.0 with --retry 1GET2 (seconds)2 s2.0 sGETinside the target band
curl 8.18.0 with --retry 1GET4 (seconds)4 s4.0 sGETinside the target band
curl 8.18.0 with --retry 1GETIMF-fixdate3.0 s3.0 sGETinside the target band
curl 8.18.0 with --retry 1GETIMF-fixdate5.0 s5.0 sGETinside the target band
curl 8.18.0 with --retry 1GETRFC 850 date3.0 s3.0 sGETinside the target band
curl 8.18.0 with --retry 1GETRFC 850 date5.0 s5.0 sGETinside the target band
curl 8.18.0 with --retry 1GETasctime date3.0 s3.0 sGETinside the target band
curl 8.18.0 with --retry 1GETasctime date5.0 s5.0 sGETinside the target band
curl 8.18.0 with --retry 1GETno header—1.0 sGETsent again (no target)
curl 8.18.0 with --retry 1GET“soon” (invalid)—1.0 sGETsent again, as with no header
curl 8.18.0 with --retry 1POST2 (seconds)2 s2.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POST4 (seconds)4 s4.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTIMF-fixdate3.0 s3.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTIMF-fixdate5.0 s5.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTRFC 850 date3.0 s3.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTRFC 850 date5.0 s5.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTasctime date3.0 s3.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTasctime date5.0 s5.0 sPOST with its bodyinside the target band
curl 8.18.0 with --retry 1POSTno header—1.0 sPOST with its bodysent again (no target)
curl 8.18.0 with --retry 1POST“soon” (invalid)—1.0 sPOST with its bodysent again, as with no header
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GET2 (seconds)2 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GET4 (seconds)4 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETIMF-fixdate3.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETIMF-fixdate5.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETRFC 850 date3.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETRFC 850 date5.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETasctime date3.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETasctime date5.0 s1.0 sGETearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GETno header—1.0 sGETsent again (no target)
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429GET“soon” (invalid)—1.0 sGETsent again, as with no header
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POST2 (seconds)2 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POST4 (seconds)4 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTIMF-fixdate3.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTIMF-fixdate5.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTRFC 850 date3.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTRFC 850 date5.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTasctime date3.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTasctime date5.0 s1.0 sPOST with its bodyearlier than the target band
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POSTno header—1.0 sPOST with its bodysent again (no target)
GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429POST“soon” (invalid)—1.0 sPOST with its bodysent again, as with no header
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GET2 (seconds)2 s2.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GET4 (seconds)4 s4.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETIMF-fixdate3.0 s3.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETIMF-fixdate5.0 s5.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETRFC 850 date3.0 s3.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETRFC 850 date5.0 s5.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETasctime date3.0 s3.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETasctime date5.0 s5.0 sGETinside the target band
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GETno header—0.0 sGETsent again (no target)
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])GET“soon” (invalid)———not sent again; the code got InvalidHeader
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POST2 (seconds)2 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POST4 (seconds)4 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTIMF-fixdate3.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTIMF-fixdate5.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTRFC 850 date3.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTRFC 850 date5.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTasctime date3.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTasctime date5.0 s——not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POSTno header———not sent again; the 429 came back
Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429])POST“soon” (invalid)———not sent again; the 429 came back

With retries turned on and Retry-After sent as a value in seconds, in this measurement the wait followed it for curl 8.18.0 with --retry 1 (GET and POST); Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (GET); the wait did not follow it for GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429 (GET and POST); the request was not sent again by Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (POST).

With retries turned on and Retry-After sent as an HTTP date in the IMF-fixdate format, in this measurement the wait followed it for curl 8.18.0 with --retry 1 (GET and POST); Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (GET); the wait did not follow it for GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429 (GET and POST); the request was not sent again by Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (POST).

curl 8.18.0 with --retry 1: after a 429 to a POST, the POST arrived again with its body in this measurement.

GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429: after a 429 to a POST, the POST arrived again with its body in this measurement.

Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]): after a 429 to a POST, the POST was not sent again in this measurement.

curl 8.18.0 with --retry 1, GET: with the invalid Retry-After value “soon”, in this measurement the request came back after about as long as with no Retry-After header.

curl 8.18.0 with --retry 1, POST: with the invalid Retry-After value “soon”, in this measurement the request came back after about as long as with no Retry-After header.

GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429, GET: with the invalid Retry-After value “soon”, in this measurement the request came back after about as long as with no Retry-After header.

GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429, POST: with the invalid Retry-After value “soon”, in this measurement the request came back after about as long as with no Retry-After header.

Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]), GET: with the invalid Retry-After value “soon”, in this measurement the request was not sent again and the calling code got InvalidHeader.

Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]), POST: with the invalid Retry-After value “soon”, in this measurement the request was not sent again and the 429 came back to the calling code without an exception.

The source passages

With retries turned on and Retry-After sent as an HTTP date in the older RFC 850 format, in this measurement the wait followed it for curl 8.18.0 with --retry 1 (GET and POST); Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (GET); the wait did not follow it for GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429 (GET and POST); the request was not sent again by Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (POST).

With retries turned on and Retry-After sent as an HTTP date in the older asctime format, in this measurement the wait followed it for curl 8.18.0 with --retry 1 (GET and POST); Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (GET); the wait did not follow it for GNU Wget 1.25.0 with --tries=2 --retry-on-http-error=429 (GET and POST); the request was not sent again by Python Requests 2.34.2 with urllib3 Retry(total=1, status_forcelist=[429]) (POST).

“The response representations SHOULD include details explaining the condition, and MAY include a Retry-After header indicating how long to wait before making a new request.” — RFC 6585 §4
“The Retry-After field value can be either an HTTP-date or a number of seconds to delay after receiving the response.” — RFC 9110 §10.2.3
“A recipient that parses a timestamp value in an HTTP field MUST accept all three HTTP-date formats.” — RFC 9110 §5.6.7

Which input and configuration match your case?