locked
Can i add a retry on my RestRequest ? RRS feed

  • Question

  • User1253338400 posted

    I am running the following:

                    var client = new RestClient(localuri);
                    var request = new RestRequest();
                    request.Method = Method.GET;
                    request.Resource= "$serverstatus";
                    var response = client.Execute(request);
                    if (response.StatusCode != HttpStatusCode.OK)
                    {
                        responseError = $"{response.ErrorMessage}";
                    }
                    return responseError

    Now the server may be down for lets say a minute or so for maintenance , 

    Is there a retry parameter I can add in any way to say if the responseError is not null then retry for a maximum of 5 times ?

    thanks

    Sunday, May 23, 2021 7:37 AM

Answers

All replies