Complete the code to set the Retry-After header with a delay of 120 seconds.
response.headers['Retry-After'] = '[1]'
The Retry-After header expects a number of seconds as a string or an HTTP date. Here, 120 seconds is correct.
Complete the code to set the Retry-After header with a HTTP date string.
response.headers['Retry-After'] = '[1]'
The Retry-After header accepts HTTP-date format like "Wed, 21 Oct 2025 07:28:00 GMT".
Fix the error in setting the Retry-After header with a numeric value.
response.headers['Retry-After'] = [1]
The Retry-After header value must be a string, so the number 120 should be quoted as '120'.
Fill both blanks to set Retry-After header with seconds and check if status code is 429.
if response.status_code [1] 429: response.headers['Retry-After'] = '[2]'
We check if status code equals 429, then set Retry-After to 120 seconds.
Fill all three blanks to create a dictionary with Retry-After header set only if status is 503 and delay is over 30 seconds.
headers = {}
if status_code [1] 503 and delay [2] 30:
headers['Retry-After'] = '[3]'Check if status_code equals 503 and delay is greater than 30, then set Retry-After to 60 seconds.