When our retry code executes, it does a http post request passing in a parameter body.
The parameter body has data in it during debugging.
However, the http request content is blank, thus sending the http request resulted in a bad request error.
Why is our parameter empty when we are retrying to send an http post request?
We need to move the code to set the parameters inside the retry body.
(Polly.Retry.AsyncRetryPolicy)
This was tricky to figure out.
During debugging, the parameter has data – it was not empty.
However, the retry body is executing in its own scope.
So in the background, as it’s executing within its own scope, it does not set the variable with the values needed. So when we send the parameter to the http post request, it failed because the content is empty.