Complete the code to set the HTTP status code for a rate limit error response.
response.status_code = [1]The HTTP status code 429 means "Too Many Requests" and is used to indicate rate limiting.
Complete the code to add a 'Retry-After' header indicating how many seconds to wait before retrying.
response.headers['Retry-After'] = [1]
The 'Retry-After' header expects a number of seconds as a string, like '60' for 60 seconds.
Fix the error in the code to return a JSON response with the correct status code for rate limiting.
return JsonResponse({'error': 'Rate limit exceeded'}, status=[1])
The status code 429 is the correct code to indicate rate limit exceeded in HTTP responses.
Fill both blanks to create a dictionary with the error message and the retry time in seconds.
error_response = {'message': [1], 'retry_after': [2]The message should clearly state the rate limit error, and retry_after should be the wait time in seconds as an integer.
Fill all three blanks to create a full HTTP response with status code, headers, and JSON body for rate limiting.
return Response([1], status=[2], headers=[3])
The response body should contain an error message, the status code must be 429, and the headers include 'Retry-After' with seconds to wait.