GET请求

curl http://localhost:8888/mock/api

POST请求(-X可以省略,-d默认就是POST参数)

curl -X POST -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

PUT请求

curl -X PUT -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

DELETE请求

curl -X DELETE -d '{"name":"api1","content":"api1 conent","method":"get","url":"/users"}' -H 'Content-Type: application/json' http://localhost:8888/mock/api

携带Cookie

curl -b 'userId=xxx;name=xxx' https://mock/api1

//从本地cookie文件读取cookie
curl -b cookies.txt https://mock/api1

相关文章:

  • 2021-08-31
  • 2021-11-20
  • 2021-05-18
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-09-23
  • 2021-10-18
  • 2022-01-04
  • 2022-02-23
  • 2021-10-01
相关资源
相似解决方案