GET请求,获取列表
curl http://localhost:3000/posts
POST请求,新增一条记录
curl --header "Content-Type: application/json; charset=UTF-8" \
--request POST \
--data '{"title":"xyzzzz", "content":"xyzxxxxxx"}' \
http://localhost:3000/posts
DELETE请求,删除一条记录
curl --request DELETE http://localhost:3000/posts/234
PATCH请求,更新一条记录
curl --header "Content-Type: application/json; charset=UTF-8" \
--request PATCH \
--data '{"title": "xyzzzz"}' \
http://localhost:3000/posts/602396e1e6b7a60502ce1e79
Top comments (1)
可以👌🏼 加油💪🏻