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

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

问题描述

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

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?

谢谢

推荐答案

GET 在 URL 本身中放置参数,让每个人都能看到.虽然 POST 是登录和安全敏感数据的理想选择,但当您想要为动态页面添加书签时,GET 是理想的选择.

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.

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

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天全站免登陆