About the difference between post and get to pass parameters
Today, a friend gave me a piece of code that use request.querystrin not pass over the values, we find together a long time, and finally to found, the cause of the error was his method parameters in the form of written get, so request.querystrin not use value, into a post solved.
Now the difference between post and get the list:
When 1.Post data transmission, does not need to be displayed in the URL, and the Get method to be displayed in the URL. 2.Post transmission data is large, can reach 2M, and the Get method is limited due URL length of only about 1024 bytes transferred. 3.Post name suggests, is to transmit data segments to the server, from the server is to Get segment acquired data. the reason why get also can transmit data, but to tell the server design, what kind of data .Post the information you need in the end as the contents of http requests, and get http head is in the transmission.
the difference between get and post
parameters passed 1get embodiment can be seen in the page, So security is not high, whereas post safe
speed transfer 2get manner.
In the background is defined get, set method can directly obtain, without getParameter ( "name");
$ .get (....) $ .ajax (....) $ .getJSON (....) 3 and all of ajax is passed
but in different ways.
$ .get () is a way to get backstage passes
$ .ajax () requires you to configure the way back to pass, and the function () method more than $ .get, we recommend the use of this method
$ .getJSON () is passed json type of data
Development experience shows that the most important difference between the two is: get Chinese can not pass, will be messy, but it will not post garbled question
First, look at the difference get, post the 1, get data queue parameter is added to the submitted form ACTION attribute URL referred to in the various fields and values within the form-one correspondence can be seen in the URL. post through HTTP post mechanism to various fields with its contents is placed in a form HTML HEADER URL address transmitted with the ACTION attribute refers. Users do not see this process. 2, to get embodiment, a server Request.QueryString variable value acquisition for post embodiment, the server acquires data submitted by Request.Form. Parameters can be used in two ways to get Request. 3, the amount of data transferred get smaller, not larger than 2KB. Post large amount of data transmission, typically default to unlimited. But in theory, due to different servers varies. 4, get security is very low, post high security. 5, <form method = "get" action = "a.asp? B = b"> with <form method = "get" action = "a.asp"> is the same, that is to say, action behind the band's page parameter list will be ignored; and <form method = "post" action = "? a.asp b = b"> with <form method = "post" action = "a.asp"> is not the same. Further Get request has the following characteristics: it will add to the URL data is transmitted to the server in this way, typically utilize a question mark? Representative of the beginning end of the URL address and data parameters, followed by a data parameter for each parameter in the form "name = value" occurs, and the parameters using the parameter between a connector & To distinguish. Post requests have the following characteristics: HTTP data is placed in the body, which is more than one organization, there & connections, there delimiter way, the hidden parameter, bulk data transfer, more convenient. In short: when we were submitting the form we usually post way, when we want to transfer a large data file, need post. When the value of parameter passed only mode (this value is not greater than 2KB) when, to the get method.
So for ajax submit both the use of naturally clear
2008-09-12 15:50
Finishes:
GET URL is added to the parameter data queue to submit the form referred to in the ACTION attribute, and the value of the respective fields correspond form, it can be seen in the URL. post by the HTTP post mechanism to various fields with its contents is placed in a form HTML HEADER URL address transmitted with the ACTION attribute refers. Users do not see this process. 通过get方法提交数据,可能会带来安全性的问题。比如一个登陆页面。当通过get方法提交数据时,用户名和密码将出现在URL上。如果: post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。
#####################################
表单提交中Get和Post方式的区别有5点 get与post的区别2 Get:是以实体的方式得到由请求URI所指定资源的信息,如果请求URI只是一个数据产生过程,那么最终要在响应实体中返回的是处理过程的结果所指向的资源,而不是处理过程的描述。 很理论化,但是很标准,method=“get”并不是从服务器上获取数据,get和post 只是发送机制不同,并不是一个取一个发! get方法会在IE地址栏里显示表示你提交时候所带的值;post方法不会 1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 另外,Get请求有如下特性:它会将数据添加到URL中,通过这种方式传递到服务器,通常利用一个问号?代表URL地址的结尾与数据参数的开端,后面的参数每一个数据参数以“名称=值”的形式出现,参数与参数之间利用一个连接符&来区分。 post 地址栏不会出现一大串?bjnghfgreygt这样的东西 1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 |
今天一朋友给我一段代码,说使用request.querystrin得不到传过来的值,我们一起找到很长时间,终于给找到了,错误的原因是他将form中的method参数写成了get了,所以使用request.querystrin得不到值,改成post就解决了。
现在列出post与get的区别:
1.Post传输数据时,不需要在URL中显示出来,而Get方法要在URL中显示。
2.Post传输的数据量大,可以达到2M,而Get方法由于受到URL长度的限制,只能传递大约1024字节.
3.Post顾名思义,就是为了将数据传送到服务器段,Get就是为了从服务器段取得数据.而Get之所以也能传送数据,只是用来设计告诉服务器,你到底需要什么样的数据.Post的信息作为http请求的内容,而Get是在Http头部传输的。
get和post的区别
1get方式传递的参数可以在页面上看见,So安全性不高,反之post安全性高
2get方式传递的速度快。
在后台定义了get,set方法可以直接获取,不用getParameter("name");
$.get(....) $.ajax(....) $.getJSON(....)3个都是ajax传递
只是方式不同。
$.get()是以get方式传递到后台
$.ajax()需要你配置传递到后台的方式,而且功能比$.get()方法多,建议使用这个方法
$.getJSON()传递的是json数据类型
开发经验表明,两者最重要的区别是:get不能传中文,会乱码,而post就不会出现乱码问题了
首先看一下get、post的区别 1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 2、 对于get方式,服务器端用Request.QueryString获取变量的值,对于post方式,服务器端用Request.Form获取提交的数据。两种方式的参数都可以用Request来获得。 3、get传送的数据量较小,不能大于2KB。post传送的数据量较大,一般被默认为不受限制。但理论上,因服务器的不同而异. 4、get安全性非常低,post安全性较高。 5、 <form method="get" action="a.asp?b=b">跟<form method="get" action="a.asp">是一样的,也就是说,action页面后边带的参数列表会被忽视;而<form method="post" action="a.asp?b=b">跟<form method="post" action="a.asp">是不一样的。 另外 Get请求有如下特性:它会将数据添加到URL中,通过这种方式传递到服务器,通常利用一个问号?代表URL地址的结尾与数据参数的开端,后面的参数每一个数据参数以“名称=值”的形式出现,参数与参数之间利用一个连接符&来区分。 Post请求有如下特性:数据是放在HTTP主体中的,其组织方式不只一种,有&连接方式,也有分割符方式,可隐藏参数,传递大批数据,比较方便。 总而言之:当我们在提交表单的时候我们通常用post方式,当我们要传送一个较大的数据文件时,需要用post。当传递的值只需用参数方式(这个值不大于2KB)的时候,用get方式即可。
所以对于ajax提交两者用法自然就明了了
2008-09-12 15:50
终结:
get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 通过get方法提交数据,可能会带来安全性的问题。比如一个登陆页面。当通过get方法提交数据时,用户名和密码将出现在URL上。如果: post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。
#####################################
表单提交中Get和Post方式的区别有5点 get与post的区别2 Get:是以实体的方式得到由请求URI所指定资源的信息,如果请求URI只是一个数据产生过程,那么最终要在响应实体中返回的是处理过程的结果所指向的资源,而不是处理过程的描述。 很理论化,但是很标准,method=“get”并不是从服务器上获取数据,get和post 只是发送机制不同,并不是一个取一个发! get方法会在IE地址栏里显示表示你提交时候所带的值;post方法不会 1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 另外,Get请求有如下特性:它会将数据添加到URL中,通过这种方式传递到服务器,通常利用一个问号?代表URL地址的结尾与数据参数的开端,后面的参数每一个数据参数以“名称=值”的形式出现,参数与参数之间利用一个连接符&来区分。 post 地址栏不会出现一大串?bjnghfgreygt这样的东西 1、 get是把参数数据队列加到提交表单的ACTION属性所指的URL中,值和表单内各个字段一一对应,在URL中可以看到。post是通过HTTP post机制,将表单内各个字段与其内容放置在HTML HEADER内一起传送到ACTION属性所指的URL地址。用户看不到这个过程。 |