首页 > Web开发 > 详细

【每天一个linux命令】curl

时间:2017-11-07 11:59:00      阅读:324      评论:0      收藏:0      [点我收藏+]

curl:访问http请求

1、不带参数的 get 访问网址

curl https://www.baidu.com/

2、带参数的 post 访问网址

# 原始http请求1
http://192.168.129.152:8090/queryRoadBookIdByRange.do?longitude=113.04817071797032&latitude=35.176670000049185&cityName=焦作市

# linux访问方式
curl -d "longitude=118.716157&latitude=31.987544&cityName=南京市" http://192.168.34.133:8090/queryRoadBookIdByRange.do
# 原始http请求
http://192.168.129.152:8090/routeMatch.do?path={ "path": [ { "lat": 31.995947740248248, "lon": 118.7367041372443 } ] }

# linux访问方式 - "要加转义字符 \
curl -d "path={ \"path\": [ { \"lat\": 31.995947740248248, \"lon\": 118.7367041372443 } ] }" http://192.168.129.152:8090/routeMatch.do

 

【每天一个linux命令】curl

原文:http://www.cnblogs.com/bxbyy/p/7798184.html

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