Skip to content
Hunter Wu edited this page Jan 16, 2019 · 3 revisions

cURL

  • -i 顯示 response header
  • -v verbose,可觀察 request header
curl -i -v https://api.github.com/users/wmh
  • -b -c 可存取 cookie
curl -b cookie.txt -c cookie.txt http://localhost/login
  • -D 把 response header 寫入檔案
curl -D headers.txt http://localhost/
  • -d POST
curl -d "user=user&password=pass" http://localhost/login
  • -F form string (for file upload)
curl -F "user=user" -F "key=val" -F "file=@/tmp/file.png" http://localhost/upload
  • -u 帶入帳號/密碼
curl -i -u username https://api.github.com/users/wmh
curl -i -u username:password https://api.github.com/users/wmh
  • S3 putObjct to presignedURL
curl -XPUT -H "Content-type: image/png" -T file.png {{presignedURL}}

wget

  • 直接使用 header 提供的檔名存檔
wget --content-disposition
Clone this wiki locally