指定用户代理
1 | # -A, --user-agent <name> Send User-Agent <name> to server |
设置参照页(referer)
1 | # -e, --referer <URL> Referrer URL |
使用 cURL 进行认证
HTTP Basic 认证
- 使用
Authorization
头部
1 | curl -H "Authorization: Basic Z3Vlc3Q6Z3Vlc3Q=" http://localhost:8080/validation/basic |
- 使用
-u
完成 HTTP 或 FTP 认证
1 | # curl -u user:pass |
只打印返回头部信息
1 | curl -I http://localhost:8080/validation/basic |
打印响应头部信息
1 | # -i, --include Include protocol response headers in the output |
使用其他 HTTP 方法
1 | # -X, --request <command> Specify request command to use |
发送数据到服务器
1 | # -d, --data <data> HTTP POST data |
将 Cookie 写入到文件中
1 | # -c, --cookie-jar <filename> Write cookies to <filename> after operation |
使用Cookie
1 | # -b, --cookie <data> Send cookies from string/file |
开启新的会话(Session)
1 | # -j, --junk-session-cookies Ignore session cookies read from file |