PHP如何模拟安卓设备,请求API接口的数据


抓包获取的安卓设备请求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

Android php ios curl server

传说中的q 9 years, 8 months ago

模拟的时候,在头信息中携带这些参数。

今天正好看到一个php httpclient,感觉比较好用,推荐下。
http://unirest.io/php.html

ljj3388 answered 9 years, 8 months ago

可以用postman这个chrome插件,调试API接口很方便。

kidvlt answered 9 years, 8 months ago

方法多得是,看你的POST请求还是GET请求,CURL扩展可以实现!!!

HgXzMn answered 9 years, 8 months ago

用curl设置ua,把post头部弄一样

米修的哈士奇 answered 9 years, 8 months ago

Your Answer