抓包擷取的安卓裝置請求API時候攜帶了這麼一大堆資料,PHP如何類比這些資料?
customerId: 801
clientAgent: M351#1080*1800
versionId: 5.6.2
model: Generic/AnyPhone
contentformat: json2
userId: 412B46585B10A8B8A8AAC6E7F92B8811
Token: 7531756a785967676c4a6371664b33767531452b356b506e
agency: MeizuStore01
clientTest: false
Content-Length: 609
Content-Type: application/x-www-form-urlencoded
Host: mobds.ganji.cn
Connection: Keep-Alive
User-Agent: Paros/3.2.13
回複內容:
抓包擷取的安卓裝置請求API時候攜帶了這麼一大堆資料,PHP如何類比這些資料?
customerId: 801
clientAgent: M351#1080*1800
versionId: 5.6.2
model: Generic/AnyPhone
contentformat: json2
userId: 412B46585B10A8B8A8AAC6E7F92B8811
Token: 7531756a785967676c4a6371664b33767531452b356b506e
agency: MeizuStore01
clientTest: false
Content-Length: 609
Content-Type: application/x-www-form-urlencoded
Host: mobds.ganji.cn
Connection: Keep-Alive
User-Agent: Paros/3.2.13
類比的時候,在頭資訊中攜帶這些參數。
今天正好看到一個php httpclient,感覺比較好用,推薦下。
http://unirest.io/php.html
用curl設定ua,把post頭部弄一樣
方法多得是,看你的POST請求還是GET請求,CURL擴充可以實現!!!
可以用postman這個chrome外掛程式,調試API介面很方便。
postman 可以添加多種類型的資訊 包含這些頭資訊