The CURL User Agent

前端 未结 4 532
离开以前
离开以前 2020-12-11 15:11

So how can I check using codeigniter if the client is curl, and then return something different for it?

4条回答
  •  时光取名叫无心
    2020-12-11 15:50

    cURL stands for - Client URL Library and the whole point of it is to be able to make requests that are identical to what a client would make.

    The only thing you can do is detect the information that is part of the request, such as the IP address, HTTP Request Headers, cookies/session id cookie, URL (path/page), and any post/get data. If the person using curl to make the request is doing it from an expected IP address and is supplying any expected header/cookie/token/URL/post/get values, then you would not be able to distinguish a curl request from a browser making the request.

提交回复
热议问题