VOOZH about

URL: https://qiita.com/mazgi/items/585348b6cdff3e320726

⇱ cURLでHTTPステータスコードだけを取得する #curl - Qiita


👁 Image
322

Go to list of users who liked

232

Share on X(Twitter)

Share on Facebook

Add to Hatena Bookmark

More than 5 years have passed since last update.

@mazgi(Hidenori Matsuki)in👁 Image
株式会社ディー・エヌ・エー

cURLでHTTPステータスコードだけを取得する

322
Last updated at Posted at 2013-12-30

curlでHTTPステータスコードだけを取得する方法をいつも忘れるのでメモ。

$curl -LI mazgi.com -o /dev/null -w '%{http_code}\n' -s
200

こんな感じで -w (write out)で http_code を指定しつつ、他は -o (output)で /dev/null にでも捨てる。
そして -s (silent)を指定して「進捗どうですか?」を表示しないようにする。

322

Go to list of users who liked

232
1

Go to list of comments

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
322

Go to list of users who liked

232