LoginSignup
0
0

More than 1 year has passed since last update.

curlとAdvanced REST clientでAPIの動作確認する

Last updated at Posted at 2021-12-21

目的

APIを開発して動作確認したいです。エンジニアだけならcurlを使えば問題無いですが、エンジニア以外の方に確認してもらうのにはGUIが無いとつらいのでAdvanced REST client(ARC)を使います。

使い方

curl

curlは良く使う簡単な例だけあげておきます。

GET

curl "http://api.example.com/users"

ヘッダー付きGET

curl -H "aaa=bbb" "http://api.example.com/users"

POST

curl -X POST -d "aaa=bbb" "http://api.example.com/users"

POST(JSONファイル)

curl -X POST -H "Content-Type: application/json" -d @data.json "http://api.example.com/users"

おまけ(ファイルダウンロード)

curl -OL "http://api.example.com/users.zip"

ARC

Google Chromeの拡張機能(アプリ)です。インストール先はこちらです。

スクリーンショット 2021-12-20 095146.png

おまけ

https://httpbin.orgは様々なAPIが用意されていてクライアントの確認やテストなどに便利です。

0
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
0
0