QuestionQ85

Using APIs

Question Image

Refer to the exhibit. Which code snippet completes this code to handle API rate limiting?

  • A response.status_code == 429
  • B response.status_code != 408
  • C response.status != 408
  • D response.status_code != 429
Explanation

HTTP status code 429 means that the client has sent too many requests. The retry loop should continue for a 429 response and break for every other response, which requires response.status_code != 429. The Requests library exposes the numeric HTTP status through Response.status_code.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!