admin管理员组文章数量:1426609
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: '' })
<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>
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>
Share
Improve this question
asked Jan 7, 2020 at 22:56
mannymanny
41511 silver badges24 bronze badges
1 Answer
Reset to default 5Axios 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.
本文标签: javascriptWhat is axios rate limitStack Overflow
版权声明:本文标题:javascript - What is axios rate limit? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745482054a2660216.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论