Linux curl命令详解

来自Wikioe
Eijux讨论 | 贡献2021年5月22日 (六) 20:28的版本 (建立内容为“category:curl == 关于 == 【转自:'''[http://aiezu.com/article/linux_curl_command.html http://aiezu.com/article/linux_curl_command.html]'''】 == 语…”的新页面)
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索


关于

【转自:http://aiezu.com/article/linux_curl_command.html

语法

curl [options] [URL...]

curl命令参数详解:

参数组 参数 描述
url url 需要抓取的一到多个URLs;

支持多个通配符方式:

  1. http://{www,ftp,mail}.aiezu.com
  2. http://aiezu.com/images/[001-999].jpg
  3. http://aiezu.com/images/[1-999].html
  4. ftp://aiezu.com/file[a-z].txt
请求头 -H "name: value"

--header "name: value"

(HTTP)添加一个http header(http请求头);
-H "name:"

--header "name:"

(HTTP)移除一个http header(http请求头);
-A "string"

--user-agent "string"

(HTTP)设置Http请求头“User-Agent”,服务器通过“User-Agent”可以判断客户端使用的浏览器名称操作系统类型,伪造此参数能导致服务器做出错误判断。
  • 也可以使用-H--header option设置此选项;
-e <URL>

--referer <URL>

(HTTP)设置访问时的来源页面,告诉http服务从哪个页面进入到此页面;
  • -e "xxx.com"相当于-H "Referer: www.xxx.com"






























































































































命令 描述

相关方法: