本帖最后由 cxlater 于 2016-9-7 23:13 编辑
$url = "http://pub.alimama.com/pubauc/getCommonCampaignByItemId.json?itemId=528423266110"
$oHTTP = ObjCreate("WinHttp.WinHttpRequest.5.1")
$oHTTP.Open("get",$url,false)
$oHTTP.setRequestHeader("Cookie", $iecookies)
$oHTTP.Send()
$dxjson = $oHTTP.responseText
ConsoleWrite(BinaryToString($dxjson ,4))
代码中请求的url需要登录信息,$iecookies是从另外一个程序创建的ie embeded对象里通过document.cookie读取到的(该对象里的页面已经处于登录状态),想通过winhttp提交cookie保持登录的,但是这样提交之后没有得到预期的json文本
是哪里的问题呢
获取到的cookie为:_tb_token_=mwm39pnzlrp; v=0; cookie32=1cbr7f1fd567a76a647fb5588a4eb11c; cookie31=NzAzMzY4OTIsJUU2JTg4JTkxJUU2JTgzJUIzJUU2JTg4hTkxJUU2JTk4JUFGJUU2JUI1JUI3MTIzMjEsd2FuZ2hhbzg0ODRAMTYzLmNvbSxUQg%3D%3D; login=VT5L2mSpMGV7TQ%3D%3D; tlut=UoWwJ0ueyt39AA%3D%3D; t=8d7b2e15c953f92149b8f8fb82f88ee1; cna=zJBKEHX45BsCATFX2JlW60Hj; l=AvHxrgRy0j7TduSW97mKJJftQXOL3mVQ; isg=Alpa8V4G2ZlQOFU1UwbqYPV9rQD3Vt5lTQ3mBmTTBu241_oRTBsudSCl8Rs0
|