我正在尝试模拟 gmail 请求。基本上我打算获取所有的 json 响应。
当您Themes -> Change you background image
在 gmail 中单击时,您会看到一个 picasa 特色图库,您可以从中选择图像。我设法获取了 gmail 用于获取更多图像的请求 POST 字符串chrome developer tools -> Network -> XHR
。我将请求复制为 curl。
curl "https://mail.google.com/picker/pvr?hl=en&native=1&hostId=gm-theme" -H ":host: mail.google.com" -H ":version: HTTP/1.1" -H "origin: https://mail.google.com" -H "accept-encoding: gzip,deflate,sdch" -H "accept-language: en-US,en;q=0.8" -H "content-control: no-cache" -H "cookie: GMAIL-COOKIES" -H "content-length: 257" -H ":path: /picker/pvr?hl=en&native=1&hostId=gm-theme" -H "accept-charset: ISO-8859-1,utf-8;q=0.7,*;q=0.3" -H "user-agent: Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31" -H "content-type: application/x-www-form-urlencoded;charset=UTF-8" -H "accept: */*" -H "referer: https://mail.google.com/_/mail-static/_/js/main/m_i,t/rt=h/ver=NB-HmMH_MVQ.en./sv=1/am=!JjrcIo7GA7b0RPF-I9tbYvMmngnebTyl_O_8x6inji58opxSrbuft8sKd6tLvMR8EoLV76U/d=1?random=1366542355442" -H "x-same-domain: explorer" -H ":scheme: https" -H ":method: POST" --data "start=2050&numResults=50&sort=3&desc=true&data=0&view=2&service=picasa&type=featured&options=%7B%22excludeLabels%22%3Anull%7D&token=MY-TOKEN&version=4&subapp=5&app=2&clientUser=16140887335626099390&authuser=0"
当我在 curl 中运行它时,我没有收到一个 json 文件,而是收到一个混淆/加密的文本,例如:link
为什么响应不是这样的 json 文本:link