首页 > Web开发 > 详细

curl 模拟 http发送get/post请求

时间:2018-07-05 00:20:52      阅读:274      评论:0      收藏:0      [点我收藏+]

参考https://blog.csdn.net/u012340794/article/details/71440604

 

使用curl 发送GET请求

curl http://localhost:8081/login?admin&asp;password=123456

 

使用curl 发送POST请求

curl -d "admin&asp;password=123456" http://localhost:8081/login

使用curl 发送JSON字符串的POST请求

这种方法是参数直接在header里面的,如需将输出指定到文件可以通过重定向进行操作.
curl -H "Content-Type:application/json" -X POST -d ‘json data‘ URL

例如: curl -H "Content-Type:application/json" -X POST -d ‘{"username": "0","password": "10"}‘ http://localhost:8081/login

curl 模拟 http发送get/post请求

原文:https://www.cnblogs.com/slovey/p/9265962.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!