ios - PHP如何類比安卓裝置,請求API介面的資料

來源:互聯網
上載者:User
抓包擷取的安卓裝置請求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 可以添加多種類型的資訊 包含這些頭資訊

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.