概要
curl を使って cookie を保存したり、送ったりします。
例は localhost への接続です。
環境に合わせて http://localhost を書き換えてください。
保存
localhost から受け付けたCookieを cookie.txt として保存
curl -c cookie.txt http://localhost
送信 (ファイルから)
localhost に保存した cookie.txt を送信
curl -b cookie.txt http://localhost
送信 (任意の Key、Value)
任意の Key Value を指定して送信
curl -b "KEY=VALUE" http://localhost
保存しつつ送信もする
curl -c cookie.txt -b cookie.txt http://localhost
ついでにヘッダも表示
curl -c cookie.txt -b cookie.txt -D http://localhost