How to use curl to get a GET request exactly same as using Chrome?

前端 未结 3 831
北海茫月
北海茫月 2020-12-07 12:57

I have a web api http://something.com/api and I want to use GET to get the response body.

This is my command:

curl \"http://something.co         


        
3条回答
  •  南笙
    南笙 (楼主)
    2020-12-07 13:42

    Check the HTTP headers that chrome is sending with the request (Using browser extension or proxy) then try sending the same headers with CURL - Possibly one at a time till you figure out which header(s) makes the request work.

    curl -A [user-agent] -H [headers] "http://something.com/api"

提交回复
热议问题