博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Being a Servlet: request AND response(Head First Servlets and JSP)
阅读量:5340 次
发布时间:2019-06-15

本文共 1646 字,大约阅读时间需要 5 分钟。

  Each request runs in a separate thread!

  When you use GET, the parameter data shows up in the browser’s input bar, right after actual URL (and separated with a “?”). Still another issue is whether you need or want end-users to be able to bookmark the request page. GET requests can be bookmarked; POST requests cannot. That might be really important if you have, say, a page that lets users specify search criteria. The users might want to come back a week later and try the same search again now that there’s new data on the server.

  But besides size, security, and bookmarking, there’s another crucial difference between GET and POST—the way they’re supposed to be used. GET is meant to be used for getting things. Period. Simple retrieval. Sure, you might use the parameters to help figure out what to send back, but the point is—you’re not making any changes on the server! POST is meant to be used for sending data to be processed. This could be as simple as query parameters used to figure out what to send back, just as with a GET, but when you think of POST, think: update. Think: use the data from the POST body to change something on the server.

  An HTTP GET is just for getting things, and it’s not supposed to change anything on the server. So a GET is, by definition (and according to the HTTP spec) idempotent. It can be executed more than once without any bad side effects. POST is not idempotent—the data submitted in the body of a POST might be destined for a transaction that can’t be reversed. So you have to be careful with your doPost() functionality! 

转载于:https://www.cnblogs.com/zhtf2014/archive/2010/03/29/1700160.html

你可能感兴趣的文章
python 用数组实现队列
查看>>
认证和授权(Authentication和Authorization)
查看>>
Mac上安装Tomcat
查看>>
CSS3中box-sizing的理解
查看>>
传统企业-全渠道营销解决方案-1
查看>>
Lucene全文检索
查看>>
awk工具-解析1
查看>>
推荐一款可以直接下载浏览器sources资源的Chrome插件
查看>>
CRM product UI里assignment block的显示隐藏逻辑
查看>>
展望未来,总结过去10年的程序员生涯,给程序员小弟弟小妹妹们的一些总结性忠告...
查看>>
AMH V4.5 – 基于AMH4.2的第三方开发版
查看>>
Mac下安装npm全局包提示权限不够
查看>>
Web.Config文件配置之配置Session变量的生命周期
查看>>
mysql导入source注意点
查看>>
Python: 对于DataFrame.loc传入列表和传入元组输出区别的理解
查看>>
USACO / Sorting a Three-Valued Sequence (简单题,方法正确性待证)
查看>>
Android开发中 .9.png格式图形设计:
查看>>
Linux常见命令
查看>>
ASP.NET Page执行顺序如:OnPreInit()、OnInit()
查看>>
linux下编译安装nginx
查看>>