11
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

curlでCookieを保存、送信する

Last updated at Posted at 2020-06-13

概要

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

11
5
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
11
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?