LoginSignup
9
7

More than 5 years have passed since last update.

curl よく使うオプションメモ!

Last updated at Posted at 2015-01-15

デバッグ時

curl -v http://localhost

ヘッダのみ取得

curl --head http://localhost

※利用するプロキシや、CDNなどで--headをつけると、意図しないレスポンスが帰ってくる可能性あり。

ヘッダ付与(例はUA)

curl --head -H 'User-Agent: Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1)' http://localhost

catの出力をそのまま、curlでpost

cat hoge.txt | curl  http://localhost/ -X POST -d @-

参考:http://www.hcn.zaq.ne.jp/___/unix/curl_manpage.html

9
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
7