Loading

Curl 中 关于PUT, POST, DELETE, UPDATE 的使用

POST

curl -H "Content-Type:application/json" -X POST --data '{"id":1, "text":"davirain", "completed":false}' http://localhost:3030/todos

GET

curl -H "Content-Type:application/json" -X GET http://localhost:3030/todos

PUT curl -H "Content-Type:application/json" -X PUT --data '{"id":3, "text":"suyinrong", "completed":false}' http://localhost:3030/todos/3 DELETE curl -v -H "Content-Type:application/json" -H "authorization:Bearer admin" -X DELETE http://localhost:3030/todos/1

  

posted @ 2021-01-31 23:31  RainDavi  阅读(406)  评论(0编辑  收藏  举报