public HttpResponseMessage Submit(string data)
{
...do some sutff...
return new HttpResponseMessage(HttpStatusCode.OK)
{
Content = new StringContent("Success", System.Text.Encoding.UTF8, "text/plain")
};
}
一切顺利。在代码库的另一个区域中,有一组方法需要重试,我们安装了Polly nuget包,并在重试中添加,在Visual Studio中本地运行时,一切看起来都很好。一旦我们部署了Azure,事情就会变糟。
{
"Version": {
"_Major": 1,
"_Minor": 1,
"_Build": -1,
"_Revision": -1
},
"Content": {
"Headers": [
{
"Key": "Content-Type",
"Value": [
"text/plain; charset=utf-8"
]
}
]
},
"StatusCode": 200,
"ReasonPhrase": "OK",
"Headers": [],
"RequestMessage": null,
"IsSuccessStatusCode": true
}
如果我们卸载波利,一切都会恢复正常。
我们唯一能找到的其他评论/问题是:
Web API returning HttpResponseMessage object after nuget updates in Azure Web App
2个问题:
-
-
波利身上有没有什么我在配置等方面漏掉的东西可能会导致这种情况?