2017-12-02 154 views
0

我想反向工程的一個API我不控制的服務器。起初我認爲以下網址(它不需要任何憑證登錄):使用郵差得到500內部錯誤發送有效負載

https://www.abc.ca.gov/datport/lqs.html?rpttype=3&rptdateoffset=0

使用Chrome瀏覽器開發工具,我看到的數據是通過以下網址顯示: https://www.abc.ca.gov/LQSService.svc/LicenseRequest

我用的網址,郵差作爲POST請求:

POST https://www.abc.ca.gov/LQSService.svc/LicenseRequest

鉻工具顯示ř郵遞員請求eQUEST的有效載荷我在身體(原)使用方法:

{"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>"} 

當我在郵差執行請求我收到以下錯誤:

{ 
"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 

}

從結果表明:

jsonerror →true 

請求頭還示出了我加入到郵遞員請求(頭)具有相同的錯誤發生的情況如下:

X-Requested-With:XMLHttpRequest 
Cookie:ASPSESSIONIDCWQRCBDR=IBNIPHCCIGMJLKOPDMDJKCPJ 

我還增加了以下的Cookie中郵差,以及:

ASPSESSIONIDCWQRCBDR=IBNIPHCCIGMJLKOPDMDJKCPJ; path=/; domain=.www.abc.ca.gov; Expires=Tue, 19 Jan 2038 03:14:07 GMT; 

我還有什麼東西可能會丟失或未在郵遞員請求中正確指定?

如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 

回答

0

原來我只需要指定頭的Content-Type

相關問題