CURL://

首图

CURL来源

The tool was about uploading and downloading data specified with a URL. It was a client-side program (the 'c'), a URL client, and would show the data (by default). So 'c' for Client and URL: cURL.

不带参数

不带有任何参数时,curl 就是发出 GET 请求。

curl https://www.qian.blue

-A参数指定客户端的用户代理标头,即User-Agent。curl 的默认用户代理字符串是curl/[version]。

$ curl -A 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36' https://qian.blue

-b

-b参数用来向服务器发送 Cookie。

$ curl -b 'foo=bar' https://qian.blue

上面命令会生成一个标头Cookie: foo=bar,向服务器发送一个名为foo、值为bar的 Cookie。

$ curl -b 'foo1=bar;foo2=bar2' https://qian.blue

上面命令发送两个 Cookie。

$ curl -b cookies.txt https://www.qian.blue

参考:https://www.qian.blue/archives/curl-help.html#toc_1

posted @ 2022-02-27 18:11  Indullged  阅读(58)  评论(0编辑  收藏  举报