当前位置:网站首页>doGet与doPost
doGet与doPost
2022-07-25 16:03:00 【clear0217】
doGet与doPost
一、简介
1、doGet
doGet 调用用于获取服务器信息,并将其做为相应放回给客户端。经由Web浏览器或通过HTML、JSP直接访问Servlet的URL时,一般用Get调用
2、doPost
它用于客户端把数据传送到服务器端,是可以隐藏传送给服务器的任何数据。Post适合发送大量的数据。
二、区别
1、生成方式
get生成方式有四种:1)直接在URL地址栏中输入URL。2)网页中的超链接。3)form中method为get。4)form中method为空时,默认是get提交。
post生成方式:form中method属性为post。
2、数据传送方式
get方式:表单数据存放在URL地址后面。所有get方式提交时HTTP中没有消息体。
post方式:表单数据存放在HTTP协议的消息体中以实体的方式传送到服务器。
3、服务器获取数据方式
GET方式:服务器采用request.QueryString来获取变量的值。
POST方式:服务器采用request.Form来获取数据。
4、传送的数据量
GET方式:数据量长度有限制,一般不超过2kb。因为是参数传递,且在地址栏中,故数据量有限制。
POST方式:适合大规模的数据传送。因为是以实体的方式传送的。
5、安全性
GET方式:安全性差。因为是直接将数据显示在地址栏中,浏览器有缓冲,可记录用户信息。所以安全性低。
POST方式:安全性高。因为post方式提交数据时是采用的HTTP post机制,是将表单中的字段与值放置在HTTP HEADER内一起传送到ACTION所指的URL中,用户是看不见的。
6、在用户刷新时
GET方式:不会有任何提示、
POST方式:会弹出提示框,问用户是否重新提交
边栏推荐
猜你喜欢

【图像隐藏】基于混合 DWT-HD-SVD 的数字图像水印方法技术附matlab代码

I interviewed 8 companies and got 5 offers in a week. Share my experience

一文理解分布式开发中的服务治理

Analysis and solution of data and clock mismatch delay in SPI transmission

Okaleido launched the fusion mining mode, which is the only way for Oka to verify the current output

进程之间的通信(管道详解)
![Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]](/img/fb/8178388f8c9ac80d95140378d24238.png)
Leetcode:528. select randomly according to the weight [ordinary random failure + prefix and dichotomy]
![[JS advanced] JS regular correlation functions and regular objects_ 02](/img/a0/27bf3f5146a5774eb3167a69d1e3cf.png)
[JS advanced] JS regular correlation functions and regular objects_ 02

使用Huggingface在矩池云快速加载预训练模型和数据集

MQTT X CLI 正式发布:强大易用的 MQTT 5.0 命令行工具
随机推荐
Record Locks(记录锁)
MySQL isolation level transactions
MySQL read / write lock
解决Win10磁盘占用100%
Boomi荣获“多元化最佳首席执行官奖”和“职业成长最佳公司奖”,在大型公司类别中跻身50强
Experimental reproduction of image classification (reasoning only) based on caffe resnet-50 network
MySQL页锁
What is a physical firewall? What's the effect?
EMQX Cloud 更新:日志分析增加更多参数,监控运维更省心
mysql意向锁
使用 Terraform 在 AWS 上快速部署 MQTT 集群
MATLAB optimization tool manopt installation
Permission management - role assignment menu
Typescript learning 1 - data types
Baseband simulation system experiment of 4pam in Gaussian channel and Rayleigh channel
权限管理-删除菜单(递归)
Permission management - delete menu (recursive)
MySQL tutorial 71-where conditional query data
[Shakespeare: keep the fun of being a man]
Promise期约