Get/POST 网络请求的不同
来源:互联网 发布:网络接入服务商 编辑:程序博客网 时间:2024/05/22 10:47
get方式和post方式的区别:
1.请求的URL地址不同:
post:"http://192.168.13.83:8080/itheima74/servlet/LoginServlet"
get:http://192.168.13.83:8080/itheima74/servlet/LoginServlet?username=root&pwd=123
2.请求头不同:
****post方式多了几个请求头:Content-Length Cache-Control Origin
openConnection.setRequestProperty("Content-Length", body.length()+"");
openConnection.setRequestProperty("Cache-Control", "max-age=0");
openConnection.setRequestProperty("Origin", "http://192.168.13.83:8080");
****post方式还多了请求的内容:username=root&pwd=123
//设置UrlConnection可以写请求的内容
openConnection.setDoOutput(true);
//获取一个outputstream,并将内容写入该流
openConnection.getOutputStream().write(body.getBytes());
3.请求时携带的内容大小不同
get:1k
post:理论无限制
1.请求的URL地址不同:
post:"http://192.168.13.83:8080/itheima74/servlet/LoginServlet"
get:http://192.168.13.83:8080/itheima74/servlet/LoginServlet?username=root&pwd=123
2.请求头不同:
****post方式多了几个请求头:Content-Length Cache-Control Origin
openConnection.setRequestProperty("Content-Length", body.length()+"");
openConnection.setRequestProperty("Cache-Control", "max-age=0");
openConnection.setRequestProperty("Origin", "http://192.168.13.83:8080");
****post方式还多了请求的内容:username=root&pwd=123
//设置UrlConnection可以写请求的内容
openConnection.setDoOutput(true);
//获取一个outputstream,并将内容写入该流
openConnection.getOutputStream().write(body.getBytes());
3.请求时携带的内容大小不同
get:1k
post:理论无限制
0 0
- Get/POST 网络请求的不同
- 网络请求(get&&post)
- 网络请求(get Post)
- GET POST通用的网络请求
- 网络请求 : GET POST 的区别
- 简单网络请求/GET请求/POST请求
- 【网络】Get 请求与 Post 请求的区别
- 网络请求的get,post 方法,同步,异步请求
- HTTP请求中GET和POST的不同
- 网络请求,get和post
- Get和post网络请求
- volley网络请求,get/post
- 网络请求方式 POST + GET
- HttpURLConnection,get,post,网络请求
- HttpURLConnection 网络请求 get post
- 网络请求之GET、POST请求
- 封装好的的 get 和 post网络请求
- GET POST的同步异步的网络请求
- 选择排序算法
- textarea输入框字数限制方法
- 图像分辨率和图像大小的计算
- 致命错误: opencv2/nonfree/nonfree.hpp:没有那个文件或目录
- spring中的RequestMapping的四种请求方式
- Get/POST 网络请求的不同
- android中的Plurals(Quantity Strings)类型
- python爬去搜狐论坛笔记
- STL-Set
- H5调摄像头拍照
- 拆轮子之动态加载DynamicLoadApk
- .Net多线程陷阱---Dictionary
- 牛客网在线编程(剑指offer)---字符串替换
- 自定义图片浏览器