我在.NET api-controller中有一个方法,从一个请求调用两次(请求是以http模块的角度进行的)。在运行iis express上的应用程序的机器上,一切正常(操作被调用一次)。在我们的测试环境中运行应用程序时会出现此问题。此环境由在netscaler反向代理后面运行的IIS 8服务器组成。使用fiddler我会在统计信息选项卡上看到一条说明"注意:在接收操作失败后重试此请求。"。
这是两次调用的操作:
[HttpPut]
[Route("orders/anull/{id}")]
public IHttpActionResult Anull(string id)
{
if (!_orderRepository.Anull(id))
{
return Content(HttpStatusCode.Gone, "The order could not be anulled. Ensure that the order hasn't already been anulled by reloading the page or contact developers.");
}
return Content(HttpStatusCode.NoContent, "Order was anulled");
}