为什么IE11创建时提琴手运行除空白POST请求? [英] Why does IE11 create blank post request except when Fiddler is running?

查看:280
本文介绍了为什么IE11创建时提琴手运行除空白POST请求?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我AngularJS $ HTTP POST请求我的C#的WebAPI RESTful服务在Internet Explorer 11 Firefox和Chrome在Windows 8.1中失败都工作。

My AngularJS $http post requests to my C# WebAPI restful service fail on Windows 8.1 in Internet Explorer 11. Firefox and Chrome both work.

更多的细节:


  • IT部门说,我们的网络没有代理

  • 所有自动检测和使用代理设置是所有的浏览器未检查

  • 的请求未能IIS都在我的本地和运行的本地服务器上的网站和服务

  • IE11增强保护模式关闭

  • 请求的连接头是保活(我想关闭也是一样,它还是没有)

  • 有时一个请求会成功,只能从第二个请求将失败的一切

  • 没有显示错误 - 在IE浏览器的网络选项卡上的要求只是说待处理和所有的标题和正文都是空白

  • 我使用HTTP,HTTPS不是

  • 我试过元标记X-UA兼容IE9和边缘

  • 的请求失败为自己的机器上使用IE11过的同事

  • 在所有浏览器中的所有呼叫工作完全当小提琴手正在运行

  • 的Visual Studio 2013的浏览器链接关闭(所以SignalRArtery JS文件不会不断取得调用服务器和测试干扰)

我AngularJS请求调用看起来是这样的:

My AngularJS request call looks like this:

var url = UrlService.GetUrlOfApi() + 'Account/SignIn';
var postData = { 'username' : username, 'password' : password };
$http(
{
    'url': url,
    'data': postData,
    'method': 'POST'
})
.success(function (data)
{
     ...

我的C#的服务看起来是这样的:

My C# service looks like this:

[RoutePrefix("Account")]
[AllowAnonymous]
public class AccountController : BaseController
{        
    [ResponseType(typeof(SecureResponseModel))]
    [Route("SignIn")]
    [HttpPost]
    public IHttpActionResult SignIn(HttpRequestMessage request)
    {
        try
        {
            var userSignInDetails = GetPostData<AuthenticationRequestMessage>(request);
            var token = _hisManager.AuthenticateUser(userSignInDetails.Username, userSignInDetails.Password);
            return new SignInResponseMessage(token, ApiErrorCode.success, Request);
        }
        catch(APIException e)
        {
            throw;
        }
    }

这是一个失败的调用看起来像IE11,完全空白:

This is what a failing call looks like in IE11, totally blank:

这是一个成功的呼叫外观提琴手时运行,如:

This is what a successful calls looks like when Fiddler is running:

谁能推荐任何其他设置来检查或可以尝试吗?

Can anyone recommend any other settings to check or things to try please?

推荐答案

我已经解决了这个问题。我的同事建议获取简单的情况下工作的传统调试策略 - 所以我提出,每工作一个呼叫测试后的控制器Web服务:

I have fixed this. My colleague advised the traditional debugging strategy of getting the simplest case to work - so I made a test post controller web service that worked every call:

我然后看到这个方法和失败是BaseController,其中载有这些方法的一个之间的唯一区别是:

I then saw the only difference between this method and the one that failed is the BaseController, which contained these methods:

然后我改变了code这个移除可疑的异步和等待命令:

I then changed the code to this to remove the suspicious looking async and await commands:

现在一切都完美。但是,任何人都可以解释,为什么?在谷歌上搜索我的这个问题在过去的一天,我读过有关IE浏览器发送两个包而不是一个像其他浏览器,以及对资源保持打开的连接与干扰。但我不明白这一点的await命令如何打破只在一个浏览器的连接。

Everything now works perfectly. But can anyone explain why? In my googling this problem for the past day I've read about IE sending two packets instead of one like other browsers, and about resources being left open interfering with connections. But I don't understand how this await command broke the connection in just one browser.

这篇关于为什么IE11创建时提琴手运行除空白POST请求?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆