HTTP Client Methods - GET and POST

来源:百度文库 编辑:神马文学网 时间:2024/05/01 17:22:07
There are three commonly used HTTP methods
GET POST HEAD
The GET method
The GET method is used to retrieve web pages from the server. It is a part of the request line from the client and tells the server to pass a copy of the document back to the browser or run a CGI program.
GET is also used to send user information from an online form on a web page to the server. Through this, the data is sent as a part of the URL in ‘name-value‘ pairs.
The XHTML code code for a simple form would look something like this (XHTMl is simply a slightly more advanced form of HTML):
First Name:
Last Name:

And this will be displayed in the browser as:
First Name:
Last Name:
Note: Submit button does not work here!
Now, let us suppose your name is John Doe. When you submit this form, the data is attached to the URL in name-value pairs. Each name-value pair is demarcated by a ‘&‘ sign and the data is separated from the actual URL with a ‘?‘ sign. Thus after submission the URL in the address/location bar of the browser will be as:
www.sitename/cgi-bin/validate.cgi?fname=John&lname=Doe
Note how the ? and & sign separate the URL from the data and the name-value pairs, respectively.
You can also call CGI programs by supplying data with the URL in an HTML link like:
HTTP Client Methods - GET and POST Methods GET and POST in HTML forms - what‘s the difference? Methods GET and POST in HTML forms - what‘s the difference? Http之Get/Post请求区别 HTTP POST GET 本质区别详解--转载 HTTP POST GET 本质区别详解--转载 GET POST 区别详解 HTTP协议中POST、GET、HEAD的区别是什么?分别在什么情况下使用? HTTP协议请求方式: 中GET、POST和HEAD的介绍 FIGHT AND GET NOTHING go and get it! gSOAP Calculator Service and Client 使用post与使用get区别 Jquery 的post和get请求 How to Test HTTP Post 表单提交中get和post方式的区别 [JavaScript]window.open的post與get傳遞參數比較 New organiser-----cardboard and post-it notes ruby系列教材(13):Attributes, Instance Variables, and Methods The Gone Fishin' Portfolio: Get Wise, Get Wealthy...and Get on With Your Life TwitterGadget iGoogle Twitter Client: Keyboard Shortcuts and Tips post、 用XMLHTTP Post/Get HTML页面时的中文乱码问题之完全Script解决方案 用XMLHTTP Post/Get HTML页面时的中文乱码问题之完全Script...