首页 > Windows开发 > 详细

API开发实践(二) 接受url请求

时间:2017-05-21 12:23:47      阅读:361      评论:0      收藏:0      [点我收藏+]

先简单理解GET请求与POST请求的区别

HTTP请求中POST与GET的区别

 

在浏览器地址栏输入

http://服务器地址:服务器端口/文件路径

即可访问目的文件或服务

 

如果带有参数就以

?参数名=参数值[&参数名=参数值].*

的形式添加到请求中,再在服务器中用request.getParameter()方法取出。

 

代码:url:  http://localhost:8080/APITest/getMap.java?shipperCode="*"&logisticCode="*"

1 protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
2         // TODO Auto-generated method stub
3         String shipperCode = request.getParameter("ShipperCode");
4         String logisticCode = request.getParameter("LogisticCode");
5         
6     }

改写了POSTt方法,

API开发实践(二) 接受url请求

原文:http://www.cnblogs.com/cxy2016/p/6884264.html

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