【发布时间】:2017-12-03 15:31:38
【问题描述】:
我正在尝试对我无法控制的服务器的 api 请求进行逆向工程。最初我查看以下网址(不需要任何凭据即可登录):
https://www.abc.ca.gov/datport/lqs.html?rpttype=3&rptdateoffset=0
使用 Chrome 开发工具,我看到数据通过以下 url 显示: https://www.abc.ca.gov/LQSService.svc/LicenseRequest
我在 Postman 中使用这个 url 作为 POST 请求:
发布https://www.abc.ca.gov/LQSService.svc/LicenseRequest
Chrome 工具显示了我在 Postman 请求的 Body(原始)中使用的 Request Payload:
{"data":"<ROOT><PAGENUMBER>1</PAGENUMBER><RPTTYPE>3</RPTTYPE><RPTDATEOFFSET>0</RPTDATEOFFSET><RPTDATE>11/29/2017</RPTDATE><FORMATEDDATE>Wednesday, Nov 29, 2017</FORMATEDDATE><RPTGROUP>DAILY3</RPTGROUP></ROOT>"}
当我在 Postman 中执行请求时,出现以下错误:
{
"ExceptionDetail": null,
"ExceptionType": null,
"Message": "The server was unable to process the request due to an internal error. For more information about the error, either turn on IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the <serviceDebug> configuration behavior) on the server in order to send the exception information back to the client, or turn on tracing as per the Microsoft .NET Framework SDK documentation and inspect the server trace logs.",
"StackTrace": null
}
结果中的Headers显示:
jsonerror →true
Chrome Request Headers 还显示了我添加到 Postman 请求(Headers)中的以下内容,但发生了相同的错误:
X-Requested-With:XMLHttpRequest
Cookie:ASPSESSIONIDCWQRCBDR=IBNIPHCCIGMJLKOPDMDJKCPJ
我还在 Postman 中添加了以下 Cookie:
ASPSESSIONIDCWQRCBDR=IBNIPHCCIGMJLKOPDMDJKCPJ; path=/; domain=.www.abc.ca.gov; Expires=Tue, 19 Jan 2038 03:14:07 GMT;
我还可能在 Postman 请求中遗漏或未正确指定哪些内容?
Chrome 中显示的完整请求标头是:
Accept:application/json, text/javascript, */*; q=0.01
Accept-Encoding:gzip, deflate, br
Accept-Language:en-US,en;q=0.9
Connection:keep-alive
Content-Length:210
Content-Type:application/json; charset=UTF-8
Cookie:ASPSESSIONIDCWQRCBDR=IBNIPHCCIGMJLKOPDMDJKCPJ; __utmt=1;
__utma=158387685.1745889465.1508735899.1512200444.1512230785.12;
__utmb=158387685.6.10.1512230783; __utmc=158387684;
__utmz=158387685.1512185091.8.2.utmcsr=google|utmccn=
(organic)|utmcmd=organic|utmctr=(not%20provided)
Host:www.abc.ca.gov
Origin:https://www.abc.ca.gov
Referer:https://www.abc.ca.gov/datport/lqs.html?
rpttype=3&rptdateoffset=0
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
X-Requested-With:XMLHttpRequest
【问题讨论】:
标签: rest web-services google-chrome postman