2

我在 .NET api-controller 中有一个方法,它从一个请求中调用两次(请求是从 angular 的 http 模块发出的)。在 iis express 上运行应用程序的机器上,一切正常(调用一次)。当应用程序在我们的测试环境中运行时会出现此问题。此环境由运行在 netscaler 反向代理后面的 IIS 8 服务器组成。使用提琴手,我在统计选项卡上收到一条注释,上面写着“注意:在接收操作失败后重试了此请求。”。

这是被调用两次的动作:

    [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");
    }
4

0 回答 0