curl 访问接口实例

2018-02-01  本文已影响0人  marksdev

curl -s -H "Content-Type: application/json" -X POST -d '{"name":"jessy","age":"3","type":"siamese"}' http://localhost:3000/cat | json

curl -s -H "Content-Type: application/json" -X POST -d '{"name":"sam","age":"5","type":"alley"}' http://localhost:3000/cat | json

curl -s -X GET http://localhost:3000/cat | json

curl -s -H "Content-Type: application/json" -X PUT -d '{"name":"sam","age":"8","type":"alley"}' http://localhost:3000/cat/sam | json

curl -s -X DELETE http://localhost:3000/cat/sam | json

上一篇下一篇

猜你喜欢

热点阅读