curlコマンドでAPIをGET, POSTする方法

GET

curl -H "Accept: application/json" -H "Content-type: application/json" -X GET [URL]

POST

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d [data] [URL]

Sample: GET

curl -H "Accept: application/json" -H "Content-type: application/json" -X GET http://127.0.0.1:8000/api/tables/

Sample: POST

curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"name":"sample table"}' http://127.0.0.1:8000/api/tables/