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

GET Link to heading

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

POST Link to heading

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

Sample: GET Link to heading

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

Sample: POST Link to heading

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