Is there a reason why HttpStatusCode 429 (Too many requests) is not listed in RetryDelegatingHandler?
PS. RetryDelegatingHandler also throws exceptions instead returning last response, swallowing the underlying error.
@markobabic If you need a C# client that respects SendGrid's retry logic documented here, I suggest you look at StrongGrid which has built-in retry and backoff when SendGrid responds with HTTP 429.
Disclaimer: I'm the author
Thanks for bringing this issue to our attention @markobabic!
I've added this to our backlog and tagged it appropriately in case someone in our C# community would like to make a PR.
I can also vouch for @Jericho's StrongGrid library.
Sure, I could have a go at it. Would you mind if I returned last http response also instead of throwing exceptions?
What do I need to know before I raise a pull request?
@markobabic Enabling the sendgrid-csharp library to retry has been discussed many times in the last few years so you should review this issue, this pull-request and this other pull-request. I'm sure there are a few more issues that I missed as well.
At the risk of repeating myself, I also suggest you look at StrongGrid which already has built-in retry and backoff when response is HTTP 429.
Since there has been no activity on this issue since March 1, 2020, we are closing this issue. Please feel free to reopen or create a new issue if you still require assistance. Thank you!