GET与POST(表单处理) [英] GET vs. POST (form processing)

查看:74
本文介绍了GET与POST(表单处理)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我完全理解两者在表单处理,用户自由裁量权和数据隐私方面的区别,但是在什么情况下,有人会在发送表单结果时使用GET over POST?

感谢

解决方案

在URL本身中获取地方参数,允许所有人看到。尽管POST对于登录和安全敏感数据来说非常理想,但当您希望将动态页面加入书签时,GET非常理想。



以一个论坛为例。显示其中所有帖子的帖子被动态加载。每个可用的线程都不存在页面,这意味着必须提供指示要加载哪个线程的参数。这些参数使用GET进行传递,以便您可以为页面添加书签,并使用提供的参数再次使用确切的URL来加载页面。

I completely understand the differences between the two in terms of form handling, user discretion and privacy of data, but in what situation would anyone rather use GET over POST when sending form results?

Thanks

解决方案

GET places parameters in the URL itself, allowing everyone to see. While POST would be ideal for logins and security-sensitive data, GET is ideal when you want a dynamic page to be bookmarked.

Take a forum for example. The thread which shows all posts within it is loaded dynamically. There doesn't exist a page for every thread available, meaning parameters must be provided which indicate which thread to load. These parameters are passed using GET so that you can bookmark the page and that exact URL with the parameters provided will be used again to load the page.

这篇关于GET与POST(表单处理)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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