1
0

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したい

Posted at

ブラウザでのPOSTとかGETとかなんかそういうやつもcurlでやりたいんや!
って人

おもむろにChromeのデベロッパーツールを立ち上げてNetworkタブを開く
image.png

例として
Qiita内をtestで検索してみたりする
image.png

なんかそれっぽいやつを Copy as cURL
image.png

こんな感じでcurlコマンドをコピれる(わー便利)

curl 'https://qiita.com/search?q=test' \
  -H 'Upgrade-Insecure-Requests: 1' \
  -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36' \
  -H 'Referer: https://qiita.com/' \
  --compressed
1
0
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
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?