Curl:修订间差异

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索
此页面具有访问限制。如果您看见此消息,则说明您没有权限访问此页面。
无编辑摘要
无编辑摘要
 
第14行: 第14行:
<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
curl -v -H "Referer: https://www.example.com/" https://httpbin.org/anything
curl -v -H "Referer: https://www.example.com/" https://httpbin.org/anything
</syntaxhighlight>
指定User-agent可以使用<code>-A</code>:
<syntaxhighlight lang="bash">
curl -v -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://httpbin.org/anything
</syntaxhighlight>
</syntaxhighlight>



2024年3月11日 (一) 07:05的最新版本

curl是一套工具,包括library以及command line tool。

范例

指定proxy可以用--proxy并且包含proxy需要的帐号密码:

curl -v --proxy https://username:password@proxy.example.com:4128/ https://httpbin.org/anything

指定referer可以用-H

curl -v -H "Referer: https://www.example.com/" https://httpbin.org/anything

指定User-agent可以使用-A

curl -v -A "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" https://httpbin.org/anything

外部连结