LoginSignup
15
14

More than 5 years have passed since last update.

コマンドラインからcurlで取得するjsonを見やすく表示する

Last updated at Posted at 2014-08-15

jsonを取得と表示

コマンドラインからjsonの中味を確認する方法です。整形されて表示されるので見やすくなります。

curlからjsonを取得
curl https://example.com/hoge.json -X GET -d "token=hogehugapiyo" | python -mjson.tool

curlでtokenパラメータのついたjsonのAPIを叩いています。

パラメータを2つつけた場合です。

curl https://example.com/hoge.json -X GET -d "token=hogehugapiyo" -d "email=hoge@example.com" | python -mjson.tool

参考

15
14
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
15
14