你的位置: 码友网首页 / 资讯源列表 / C# ways of handling when being throttled by an API

关于[C# ways of handling when being throttled by an API]的摘要:

I’ve been building a service application that is responsible to grab data from a REST API. The API has mechanisms in place to reduce abuse and make sure that everyone can consume its service in a fair way. That being said, this means that sometimes you may need to do a lot of requests to extract the data you need. If you get throttled, that is being told that you are sending too many requests and get served with a “temporary” ban, you will need to way and retry. You know it is a “temporary” ban so why would you send back an error (exception) to your client when it’s something you can possibly handle yourself. How can you deal with this in code?

原文地址: https://www.domstamand.com/csharp-ways-of-handling-when-being-throttled-by-an-api/

收录时间: 2020-11-11 浏览量: 1167 分类: C#开发

| 0 收藏 | 0