为什么在HTTP中GET方法比POST更快? [英] Why GET method is faster than POST in HTTP?

查看:133
本文介绍了为什么在HTTP中GET方法比POST更快?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



据说获取和发布数据的方法从一个页面到另一个页面方法比Post更快,但我不知道为什么它是
我能找到的一个原因是Get只能使用255个字符?
是否还有其他原因,请别人解释一下?

解决方案

速度并不多。 POST有更多适用的情况。例如,搜索引擎将索引GET URL,浏览器可以将它们加入书签并使其显示在历史记录中。因此,如果您根据GET请求执行修改数据库等操作,则可能会有害,因为某些漫游器也可能遍历URL。

另一种情况可能是安全问题。如果您使用GET发布凭证,它将在浏览器历史记录和服务器日志文件中列出。


I am just new to web programming and just curious to know abt Get and Post methods of sending data from one page to another page.

It is said that Get method is faster than Post but i don't know why is it one reason i could find is that Get can take only 255 chars with it? Is there any other reasons , please someone explain me?

解决方案

It's not much about speed. There are plenty of cases where POST is more applicable. For example, search engines will index GET URLs and browsers can bookmark them and make them show up in history. As a result, if you take actions like modifying a DB based on a GET request, it might be harmful as some bots might also traverse the URL.

The other case can be security issue. If you post credentials using GET, it'll get listed in browser history and server log files.

这篇关于为什么在HTTP中GET方法比POST更快?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆