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

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


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


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


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


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

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


postman 可以添加多种类型的信息 包含这些头信息

【热门文章】
【热门文章】