request和request.form和request.querystring的区别

作者&投稿:冉芳 (若有异议请与网页底部的电邮联系)
request和request.form和request.querystring的区别~

Request.Form:获取以POST方式提交的数据(接收Form提交来的数据);
Request.QueryString:获取地址栏参数(以GET方式提交的数据)
Request:包含以上两种方式(优先获取GET方式提交的数据),它会在QueryString、Form、ServerVariable中都搜寻一遍。
而且有时候也会得到不同的结果。如果你仅仅是需要Form中的一个数据,但是你使用了Request而不是Request.Form,那么程序将在QueryString、ServerVariable中也搜寻一遍。如果正好你的QueryString或者ServerVariable里面也有同名的项,你得到的就不是你原本想要的值了。
Request.ServerVariables中的各种参数
Request.ServerVariables("Url")
返回服务器地址
Request.ServerVariables("Path_Info")
客户端提供的路径信息
Request.ServerVariables("Appl_Physical_Path")
与应用程序元数据库路径相应的物理路径
Request.ServerVariables("Path_Translated")
通过由虚拟至物理的映射后得到的路径
Request.ServerVariables("Script_Name")
执行脚本的名称
Request.ServerVariables("Query_String")
查询字符串内容
Request.ServerVariables("Http_Referer")
请求的字符串内容
Request.ServerVariables("Server_Port")
接受请求的服务器端口号
Request.ServerVariables("Remote_Addr")
发出请求的远程主机的IP地址
Request.ServerVariables("Remote_Host")
发出请求的远程主机名称
Request.ServerVariables("Local_Addr")
返回接受请求的服务器地址
Request.ServerVariables("Http_Host")
返回服务器地址
Request.ServerVariables("Server_Name")
服务器的主机名、DNS地址或IP地址
Request.ServerVariables("Request_Method")
提出请求的方法比如GET、HEAD、POST等等
Request.ServerVariables("Server_Port_Secure")
如果接受请求的服务器端口为安全端口时,则为1,否则为0
Request.ServerVariables("Server_Protocol")
服务器使用的协议的名称和版本
Request.ServerVariables("Server_Software")
应答请求并运行网关的服务器软件的名称和版本
Request.ServerVariables("All_Http")
客户端发送的所有HTTP标头,前缀HTTP_
Request.ServerVariables("All_Raw")
客户端发送的所有HTTP标头,其结果和客户端发送时一样,没有前缀HTTP_
Request.ServerVariables("Appl_MD_Path")
应用程序的元数据库路径
Request.ServerVariables("Content_Length")
客户端发出内容的长度
Request.ServerVariables("Https")
如果请求穿过安全通道(SSL),则返回ON如果请求来自非安全通道,则返回OFF
Request.ServerVariables("Instance_ID")
IIS实例的ID号
Request.ServerVariables("Instance_Meta_Path")
响应请求的IIS实例的元数据库路径
Request.ServerVariables("Http_Accept_Encoding")
返回内容如:gzip,deflate
Request.ServerVariables("Http_Accept_Language")
返回内容如:en-us
Request.ServerVariables("Http_Connection")
返回内容:Keep-Alive
Request.ServerVariables("Http_Cookie")
返回内容如:nVisiT%
2DYum=125;ASPSESSIONIDCARTQTRA=FDOBFFABJGOECBBKHKGPFIJI;ASPSESSIONIDCAQQTSRB=LKJJPLABABILLPCOGJGAMKAM;ASPSESSIONIDACRRSSRA=DK
HHHFBBJOJCCONPPHLKGHPB
Request.ServerVariables("Http_User_Agent")
返回内容:Mozilla/4.0(compatible;MSIE6.0;WindowsNT5.1;SV1)
Request.ServerVariables("Https_Keysize")
安全套接字层连接关键字的位数,如128
Request.ServerVariables("Https_Secretkeysize")
服务器验证私人关键字的位数如1024
Request.ServerVariables("Https_Server_Issuer")
服务器证书的发行者字段
Request.ServerVariables("Https_Server_Subject")
服务器证书的主题字段
Request.ServerVariables("Auth_Password")
当使用基本验证模式时,客户在密码对话框中输入的密码
Request.ServerVariables("Auth_Type")
是用户访问受保护的脚本时,服务器用於检验用户的验证方法
Request.ServerVariables("Auth_User")
代证的用户名
Request.ServerVariables("Cert_Cookie")
唯一的客户证书ID号
Request.ServerVariables("Cert_Flag")
客户证书标志,如有客户端证书,则bit0为0如果客户端证书验证无效,bit1被设置为1
Request.ServerVariables("Cert_Issuer")
用户证书中的发行者字段
Request.ServerVariables("Cert_Keysize")
安全套接字层连接关键字的位数,如128
Request.ServerVariables("Cert_Secretkeysize")
服务器验证私人关键字的位数如1024
Request.ServerVariables("Cert_Serialnumber")
客户证书的序列号字段
Request.ServerVariables("Cert_Server_Issuer")
服务器证书的发行者字段
Request.ServerVariables("Cert_Server_Subject")
服务器证书的主题字段
Request.ServerVariables("Cert_Subject")
客户端证书的主题字段
Request.ServerVariables("Content_Type")
客户发送的form内容或HTTPPUT的数据类型

一个从浏览器到后台的请求,粗略可以分为三部分:URL、HTTP Header、HTTP Body。
Request.QueryString,就是指从URL中取参数,比如url是/api?id=xxx&name=xxx,其中的id和name就是通过QueryString才能取出来。
Request.Form,就是从Http Body中取参数,而且是针对以Form形式提交的数据,一般在页面是一定有...这样的内容,表单里可提交的数据会在http body中形成类似于id=xxx&name=xxx这样的格式,在后台通过Form提取出来。
Request代表请求对象,它封装了与请求相关的各类信息,比如来源 、http头等等,当然也包括Form和QueryString。

Request.Form:获取以POST方式提交的数据(接收Form提交来的数据);

Request.QueryString:获取地址栏参数(以GET方式提交的数据)

Request:包含以上两种方式(优先获取GET方式提交的数据),它会在QueryString、Form、ServerVariable中都搜寻一遍。

而且有时候也会得到不同的结果。如果你仅仅是需要Form中的一个数据,但是你使用了Request而不是Request.Form,那么程序将在QueryString、ServerVariable中也搜寻一遍。如果正好你的QueryString或者ServerVariable里面也有同名的项,你得到的就不是你原本想要的值了。

Request.ServerVariables中的各种参数

Request.ServerVariables("Url")
返回服务器地址

Request.ServerVariables("Path_Info")
客户端提供的路径信息

Request.ServerVariables("Appl_Physical_Path")
与应用程序元数据库路径相应的物理路径

Request.ServerVariables("Path_Translated")
通过由虚拟至物理的映射后得到的路径

Request.ServerVariables("Script_Name")
执行脚本的名称

Request.ServerVariables("Query_String")
查询字符串内容

Request.ServerVariables("Http_Referer")
请求的字符串内容

Request.ServerVariables("Server_Port")
接受请求的服务器端口号

Request.ServerVariables("Remote_Addr")
发出请求的远程主机的IP地址

Request.ServerVariables("Remote_Host")
发出请求的远程主机名称

Request.ServerVariables("Local_Addr")
返回接受请求的服务器地址

Request.ServerVariables("Http_Host")
返回服务器地址

Request.ServerVariables("Server_Name")
服务器的主机名、DNS地址或IP地址

Request.ServerVariables("Request_Method")
提出请求的方法比如GET、HEAD、POST等等

Request.ServerVariables("Server_Port_Secure")
如果接受请求的服务器端口为安全端口时,则为1,否则为0

Request.ServerVariables("Server_Protocol")
服务器使用的协议的名称和版本

Request.ServerVariables("Server_Software")
应答请求并运行网关的服务器软件的名称和版本

Request.ServerVariables("All_Http")
客户端发送的所有HTTP标头,前缀HTTP_

Request.ServerVariables("All_Raw")
客户端发送的所有HTTP标头,其结果和客户端发送时一样,没有前缀HTTP_

Request.ServerVariables("Appl_MD_Path")
应用程序的元数据库路径

Request.ServerVariables("Content_Length")
客户端发出内容的长度

Request.ServerVariables("Https")
如果请求穿过安全通道(SSL),则返回ON如果请求来自非安全通道,则返回OFF

Request.ServerVariables("Instance_ID")
IIS实例的ID号

Request.ServerVariables("Instance_Meta_Path")
响应请求的IIS实例的元数据库路径

Request.ServerVariables("Http_Accept_Encoding")
返回内容如:gzip,deflate

Request.ServerVariables("Http_Accept_Language")
返回内容如:en-us

Request.ServerVariables("Http_Connection")
返回内容:Keep-Alive

Request.ServerVariables("Http_Cookie")
返回内容如:nVisiT%

2DYum=125;ASPSESSIONIDCARTQTRA=FDOBFFABJGOECBBKHKGPFIJI;ASPSESSIONIDCAQQTSRB=LKJJPLABABILLPCOGJGAMKAM;ASPSESSIONIDACRRSSRA=DK

HHHFBBJOJCCONPPHLKGHPB

Request.ServerVariables("Http_User_Agent")
返回内容:Mozilla/4.0(compatible;MSIE6.0;WindowsNT5.1;SV1)

Request.ServerVariables("Https_Keysize")
安全套接字层连接关键字的位数,如128

Request.ServerVariables("Https_Secretkeysize")
服务器验证私人关键字的位数如1024

Request.ServerVariables("Https_Server_Issuer")
服务器证书的发行者字段

Request.ServerVariables("Https_Server_Subject")
服务器证书的主题字段

Request.ServerVariables("Auth_Password")
当使用基本验证模式时,客户在密码对话框中输入的密码

Request.ServerVariables("Auth_Type")
是用户访问受保护的脚本时,服务器用於检验用户的验证方法

Request.ServerVariables("Auth_User")
代证的用户名

Request.ServerVariables("Cert_Cookie")
唯一的客户证书ID号

Request.ServerVariables("Cert_Flag")
客户证书标志,如有客户端证书,则bit0为0如果客户端证书验证无效,bit1被设置为1

Request.ServerVariables("Cert_Issuer")
用户证书中的发行者字段

Request.ServerVariables("Cert_Keysize")
安全套接字层连接关键字的位数,如128

Request.ServerVariables("Cert_Secretkeysize")
服务器验证私人关键字的位数如1024

Request.ServerVariables("Cert_Serialnumber")
客户证书的序列号字段

Request.ServerVariables("Cert_Server_Issuer")
服务器证书的发行者字段

Request.ServerVariables("Cert_Server_Subject")
服务器证书的主题字段

Request.ServerVariables("Cert_Subject")
客户端证书的主题字段
Request.ServerVariables("Content_Type")
客户发送的form内容或HTTPPUT的数据类型


“FEI”代表什么?
在英语中,"FEI"是一个广泛使用的缩写,它代表"Federation Equestre Internationale",中文译为“国际马术联合会”。这个缩写词在马术领域具有很高的知名度,其流行度达到了2792,主要应用于体育,特别是在赛马相关的交流和组织中。FEI的中文解释即为国际马术联合会,它是一个国际性的组织,负责管理和促进...

equest tind out是什么东东啊
应该是 request timed out 请求超时 在ping命令时有时候会反馈这样的结果:“Reguest Timed Out”这种情况通常是对方拒绝接受你发送给它的数据包而造成数据包的丢失。大多数原因为对方安装了防火墙或者已经关闭了计算机或者过滤掉TVP\/IP及其ICMP报文。该种错误提示信息可能是由一下一些原因造成:1、 IP地址...

拉凡尼勒鳄鱼公园有英文名吗
毛里求斯茶园与拉凡尼勒鳄鱼公园距离9.27km 酒店毛里求斯香媞莫里斯水疗度假村 毛里求斯香媞莫里斯水疗度假村与拉凡尼勒鳄鱼公园距离9.69km 2010年开业,2013年装修,共有61间房。坐落于贝隆布尔,不论您是商务出差还是休闲旅游毛里求斯香媞莫里斯水疗度假村都是理想的下榻之处。酒店坐落于CentreEquestreDeRiamb...

FIBA是什么的缩写
国际篮球联合会(International Basketball Federation,FIBA)1932年6月18日在瑞士的日内瓦成立。创办国为阿根廷、希腊、意大利、葡萄牙、罗马尼亚、瑞士、捷克斯洛伐克和拉脱维亚共8国。现有212个协会会员,分属国际篮联承认的非、亚、美、欧和大洋洲5个大洲篮球联合会。全世界的篮球爱好者人数已达4亿,其中妇女...

介绍一下意大利的米兰,好吗?
它包含duomo和monumento equestre a vittorio emanuele II,这里经常有游人,鸽子逗留。米兰人通常匆匆忙忙奔向商店,办公地点。在大广场,duomo诞生之前,有两个教堂:Santa Tecla 和Santa Maria Maggiore. 2.维多利亚二世拱廊(Galleria Vittorio Emanuele II):古典又华丽的购物区,有许多Bar及高级的餐厅。回廊呈十字交叉,有...

石首市19817965361: request.form()和request()的区别? -
包鸿奥力: 说白了,request()是种简写,它可以获取POST方式提交的数据,也能获取GET方式提交的数据,功能上比request.query()强大.request.query()只能用来获取通过GET方式提交的数据.

石首市19817965361: ASP页面间传递参数时的区别Request、Request.Fo
包鸿奥力: 其实是Get和Post的区别. 在客户端,Get方式在通过URL提交数据,而Post提交后地栏不变. Request、Request.Form接受Post方式的传的值 Request.QueryString接受Get方式的传的值 如果不明白Get和Post的区别可以参考这里:

石首市19817965361: Jquery中request和request.form和request.querystring的区别 -
包鸿奥力: 这几个概念并不是jquery这个javascript框架的东西,而是服务器语言——ASP.NET等的范畴.这3个都是用于接收前台页面通过各种方式提交传输的数据.其中:(1)request本身是一个系统的静态对象,本身也可以作为数组调用,比如request("...

石首市19817965361: java中session和request的区别 -
包鸿奥力: request 指在一次请求的全过程中有效,即从http请求到服务器处理结束,返回响应的整个过程,存放在HttpServletRequest对象中.在这个过程中可以使用forward方式跳转多个jsp.在这些页面里你都可以使用这个变量.request是用户请求访问的...

石首市19817965361: request和request.form和request.querystring的区别 -
包鸿奥力: 1.Request.form方法,它是用来接收表单变量的(post 方法)2.Request.QueryString方法, 它是接收URL参数的 (get 方法)3.Request对象也可以不指明具体使用QueryString或是form方法,如request("变量"),因为它能自动识别,不过还...

石首市19817965361: asp中接收表单用post提交的数据,request和request.form有什么区别 -
包鸿奥力: 用Request接收数据和用Request.Form接收在速度上可能会慢一点 因为如果直接用Request的话,服务器要去搜索Request有关的全部的集合(例如QueryString集合、Cookies集合、Form集合、serverVariables集合等等),直到Form时才会确认下来,而用Request.Form服务系统会直接知道你是用Form集合接收数据,所以速度上可以说是Request.Form快一点 如果没有毕要的就直接使用Request.Form或用Request.QueryString等,这样会好一点,OK

石首市19817965361: Springmvc中在controller注入request会有线程安全问题吗 -
包鸿奥力: servlet是单例的,而tomcat则是在多个线程中调用servlet的处理方法.因此如果servlet存在实例对象,那么就会引出线程安全的问题.而springmvc允许在controller类中通过@Autowired配置request、response以及requestcontext等实例对象.这种...

石首市19817965361: 什么是软件的serial和request值 -
包鸿奥力: serial0,路由器中的串行接口,在DNS服务器中serial值非常重要,且每次更换域名服务器的时候都要更改其serial值为更大一点,这样才可以顺利与全球DNS服务器数据进行同步. request这个对象不用事先声明,就可以在JSP网页中使用,在...

石首市19817965361: 如何使用HttpRequest对象 -
包鸿奥力: HttpRequest 对象 Request获取虚拟路径和物理路径的属性或方法 请求的URL; 显示页面:Request["name"]=Tony Request.AppllicationPath=/DataProcess 虚拟应用程序路径 Request.FilePath=/DataProcess/HttpRequest.aspx 文件的虚拟路径 ...

石首市19817965361: request.QueryString("") 与 request.form("") 的区别
包鸿奥力: request.querystring 是用来接收地址里面?后面的xx=xx的内容 request.form 是用来接收表单递交来的数据 而request("offline") 就无论采用的是以上哪种方法的字段值都可以读取了

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 星空见康网