You're building a React application that needs to fetch data from a REST API and display it. However, the API occasionally takes a long time to respond. Which feature in Axios would you use to set a maximum time before the request is aborted?

  • Connection Limit
  • Delayed Response
  • Retry
  • Timeout
In Axios, the 'timeout' feature is used to set a maximum time before a request is aborted if it takes too long to respond. This is especially useful when dealing with APIs that occasionally have slow response times to prevent indefinitely waiting for a response.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *