PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, October 14, 2022

[FIXED] What is axios rate limit?

 October 14, 2022     axios, express, javascript, node.js, react-native     No comments   

Issue

Does anyone know's the rate limit of the axios api because it is throwing a lot of 429 errors when i am using it

here is my codes

const instance = axios.create({ baseURL: 'http://9rv324283.ngrok.io' })

<NavigationEvents
onWillFocus={() => {

  try {

    const response = await instance.get('fetchNewDishes');

    this.setState({data: response.data})

  } catch(err) {

    console.log(err)

  }

}}>

<TouchableOpacity onPress={() =>  instance.patch(`/postNewDish/${this.state.dish}`)}>
            <Text style={{ fontSize: 16, color: '#555', padding: 15 }}>Post Dish</Text>
          </TouchableOpacity>

Solution

Axios is an Http Client. Http Clients won't have a rate limit. However, API's typically have rate limiting implemented (especially public onces). The error message you're receiving is saying the following:

The HTTP 429 Too Many Requests response status code indicates the user has sent too many requests in a given amount of time ("rate limiting").

With that being said, the only thing you can do on your side is make requests less frequently. Rate Limiting is something implemented by the API you're using. You should consult their documentation to figure out the specifics on what their rate limits are.



Answered By - mwilson
Answer Checked By - Candace Johnson (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing