使い方メモ

curl https://example.com/temperature_130010.json // 通常
curl https://example.com/temperature_130010.json  -o result.log //戻り電文をファイル出力
curl https://example.com/temperature_130010.json  -O  //戻り電文をファイル出力
curl https://example.com/temperature_130010.json  -s // ゲージを出さない(エラーもでない)
curl https://example.com/temperature_130010.json  -Ss // ゲージを出さない(エラーは出しつつ)。
curl https://example.com/temperature_130010.json  -I // レスポンスヘッダを出す
curl https://example.com/temperature_130010.json  -i // ヘッダ、Bodyを出す
curl https://example.com/temperature_130010.json  -v // リクエストヘッダを出す
curl https://example.com/temperature_130010.json --trace temperature_130010.log //traceのログをとる1
curl https://example.com/temperature_130010.json --trace-ascii temperature_130010_ascii.log //traceのログをとる2
curl https://example.com/temperature_130010.json --trace-ascii temperature_130010_time.log --trace-time  //traceのログをとる(日時つき)

Key/valueでPOST

curl -X POST --data-urlencode 
'payload={"channel": "#general", "username": "webhookbot", 
"text": "This is posted to #general and comes from a bot named webhookbot.", 
"icon_emoji": ":ghost:"}' 
https://hooks.slack.com/services/xxxx/xxxx/xxxxx

JSONをPOST

curl -X POST 127.0.0.1:9000 -v -H 'Content-Type:appliation/json' --data '{"key":"value"}'

デフォルトは、

Content-Type: application/x-www-form-urlencoded

なので -H でContent-Typeを変更します。

関連リンク


トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS