重试发送 HTTP Post 请求的空白参数

问题描述 投票:0回答:1

当我们的重试代码执行时,它会发送一个 http post 请求并传入参数体。 调试时参数体中有数据。

但是http请求内容为空,因此发送http请求导致了bad request错误。

为什么当我们重试发送http post请求时我们的参数为空?

polly retry-logic
1个回答
0
投票

Move the code to set the variable inside the retry body

我们需要移动代码来设置重试主体内的参数。 (Polly.Retry.AsyncRetryPolicy)

这很难弄清楚。 在调试过程中,参数有数据 - 它不为空。 但是,重试主体正在其自己的范围内执行。 因此,在后台,当它在自己的作用域内执行时,它不会为变量设置所需的值。 所以当我们向http post请求发送参数时,由于内容为空而失败。

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.