curlとjqで簡単にAPIの調査をする - $shibayu36->blog;
昨日こんなかんじで、curlとjqを使ってAPIの調査を簡単にするというのを書いたけど、curlの代替品としてhttpieも便利そうだったので自分の備忘録にメモ。brewでインストールできるようだった。
特徴としては
などがありそう。JSONの出力を更にjqのように制御する方法はよくわからなかったのでそういう時は以下のようにjqと組み合わせると良さそう。
$ http --body 'https://api.trello.com/1/boards/4d5ea62fd76aa1136000000c/cards' | jq '.[0:5] | .[] | {name}'
{
"name": "What can you expect from this board?"
}
{
"name": "We also have public development boards for our mobile apps. Links inside!"
}
{
"name": "Time Tracking"
}
{
"name": "Assign people and due dates to specific checklist items."
}
{
"name": "Dependencies Between Cards"
}詳しい使い方などは他にわかりやすい解説があったので、そちらに任せます。
GitHub - httpie/httpie: As easy as /aitch-tee-tee-pie/ 🥧 Modern, user-friendly command-line HTTP client for the API era. JSON support, colors, sessions, downloads, plugins & more. https://twitter.com/httpie