PHP GET Request, sending headers

前端 未结 3 1282
刺人心
刺人心 2020-12-02 23:24

I need to perform a get request and send headers along with it. What can I use to do this?

The main header I need to set is the browser one. Is there an easy way to

3条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-02 23:59

    If you are requesting a page, use cURL.

    In order to set the headers (in this case, the User-Agent header in the HTTP request, you would use this syntax:

提交回复
热议问题