40
24

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 5 years have passed since last update.

curlで返却されるJSONを見やすく整形して表示する

Posted at

Webアプリを開発していると、Rest APIを試しに叩いてJSONの構造を見ながら進めたい場合があります。

普通にcurlで取得するとJSONが1行で表示されてしまいます。

JSONを見やすく整形する方法

パイプでpython -mjson.toolを追加するだけで、整形して見やすく表示できます。

terminal
$curl "http://api.example.com/hoge.json | python -mjson.tool

以上です。

40
24
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
40
24

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?