I have my WebResponse
wrapped in using
blocks:
using (var response = request.GetResponse())
{
// do things...
}
The webservice I'm calling will raise 429's with a Retry-After in the header.
If I wrap this in a try-catch
to listen for the WebException
then I will lose the context of the response and won't be able to read the Retry-After
element in the header.
How should I properly handle the response while also implementing retry logic for this?