# 使用curl發送GET請求
$ curl http://127.0.0.1:8080/login?user=admin&passwd=12345678
# 使用curl發送POST請求
$ curl -d "user=admin&passwd=12345678" http://127.0.0.1:8080/login
複製代碼
$ curl -H "Content-Type:application/json" http://127.0.0.1:8080
複製代碼
$ curl http://127.0.0.1:8080 -o file.txt --progress
複製代碼
$ curl http://127.0.0.1:8080 --cookie "user=root;pass=123456"
複製代碼
$ curl http://127.0.0.1:8080 --cookie-jar cookie_file
複製代碼
$ curl -I http://127.0.0.1:8080
# Accept-Ranges: bytes
# Cache-Control: private, no-cache, no-store, proxy-revalidate, no-transform
# Connection: Keep-Alive
# Content-Length: 277
# Content-Type: text/html
# Date: Thu, 29 Nov 2018 03:13:16 GMT
# Etag: "575e1f7b-115"
# Last-Modified: Mon, 13 Jun 2016 02:50:35 GMT
# Pragma: no-cache
# Server: bfe/1.0.8.18
複製代碼
$ curl http://www.baidu.com --user-agent "Mozilla/5.0"
$ curl http://www.baidu.com -A "Mozilla/5.0"
複製代碼
更多高級使用html