使用Visual Studio 2015我一直在尝试使用Visual Studio 2015创建一些自动化测试。 我使用Fiddler观察请求/响应包。 Web应用程序在IIS8.5上运行。使用Visual Studio Web性能测试回放错误
我创建了一个新的Web请求并记录到我们的网站 - 这正常工作。 然后我播放录制的测试,并登录失败,出现各种400,401和405错误。 我将详细介绍第一个失败的HTTP请求:
在记录初始登录时,提琴手员额的要求:
OPTIONS http://api.XXX.co/token HTTP/1.1
Accept: */*
Origin: http://qq.XXX.co
Access-Control-Request-Method: POST
Access-Control-Request-Headers: accept, content-type
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/6.0)
Host: api.XXX.co
Content-Length: 0
DNT: 1
Connection: Keep-Alive
Pragma: no-cache
与响应
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Expires: -1
Server: Microsoft-IIS/8.5
Access-Control-Allow-Origin: http://qq.XXX.co
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: accept,content-type
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 06 Jun 2016 16:10:47 GMT
Content-Length: 0
但是当通过Visual Studio回放同样的要求是:
OPTIONS http://api.XXX.co/token HTTP/1.1
User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)
Accept: */*
Accept-Language: en-GB
Accept-Encoding: GZIP
Host: api.XXX.co
Content-Length: 0
and th e回应是:
HTTP/1.1 400 Bad Request
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 34
Content-Type: application/json; charset=UTF-8
Expires: -1
Server: Microsoft-IIS/8.5
Server: Microsoft-IIS/8.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 06 Jun 2016 16:12:20 GMT
{"error":"unsupported_grant_type"}
在这里,我们有错误“unsupported_grant_type” - 我不知道为什么这可能会发生!
任何人都可以给我一个线索,看看这里发生了什么?