To call the ASP and CGI and other programs of the remote website, give them some parameters and get some return values, really useful. In addition to communicating, we can also take it to pressure testing on our website. MS's WAS (Web Application Stress Test Tool) is a relatively simple tool for pressure test sites. In fact, we can also write one, set threads, constantly request through the HTTP protocol and then record the return value is OK ^ _ ^.
1 HTTP header: HTTP request and HTTP response use the header to send information about the HTTP message. The head consists of a series of lines, each line contains the name, and then it is the colon, space, value. Fields can be arranged in any order. Some headers can be used for both the request header to respond to the head, while others can only use one of them.
Many request headers allow the client to specify multiple acceptable options in the value section, sometimes or even rank the preferences of these options. Multiple items are separated by commas. For example, the client can send a request header containing "content-encoding: gzip, compress," indicating that various compression types can be accepted. If the server's response body uses GZIP encoding, the response head will contain "Content-Encoding: Gzip".
Request First Example The following is a simple example of HTTP request.
GET /articles/news/today.asp HTTP / 1.1Accept: * / * Accept-Language: en-usConnection: Keep-AliveHost: localhostReferer: http: //localhost/links.aspUser-Agent: Mozilla / 4.0 (compatible; MSIE 5.5; Windows NT 5.0) Accept-encoding: Gzip, Deflate
This request has a request line, including method (GET), resource path (/articles/news/today.asp), and HTTP version (HTTP / 1.1). Since there is no body, all the content behind the request is part of the head. After the head is behind, it is a blank line, indicating that the head has ended.
The Response Header Sample Web Server can respond to the previous request in a variety of ways. Suppose the file is accessible, and the user has permission to view the file, the response is similar to:
HTTP / 1.1 200 OKServer: Microsoft-IIS / 5.0Date: Thu, 13 Jul 2000 05:46:53 GMTContent-Length: 2291Content-Type: text / htmlSet-Cookie: ASPSESSIONIDQQGGGNCG = LKLDFFKCINFLDMFHCBCBMFLJ; path = / Cache-control: private
Specifically visible MSDN2003, address is: ms-help: //ms.msdnqtr.2003feb.2052/Act/htm/actml_ref_href.htm
2 Status code: The status code needs to be obtained when requesting to determine the current state, such as normal, 404 represents un found. See MSDN2003, address: ms-help: //ms.msdnqtr.2003feb.2052/Act/htm/actml_ref_hsco.htm
3 GET and POST:
HTTP-GET and HTTP-POST are standard protocols that use HTTP (hypertext transport protocol) predicates and request semantics associated with them as a standard protocol for encoding and passing by name / value. Each protocol consists of a series of HTTP request headers that are used to define the contents of the client to the server with some other information, while the server will use a series of HTTP response headers and the requested Data response. HTTP-GET uses the MIME type of Application / X-WWW-Form-Urlencoded to deliver its parameters in the URL encoded text format, which will be added to the URL of the server that processes the requested server. URL encoding is a character encoding format that ensures that the passing parameters consist of consistent text (such as coding spaces to% 20). The appended parameters are also known as query strings. For example: http://www.rising.com.cn/download.asp? Id = 12 & Page = 11 This '?' The way to have two parameter IDs and PAGEs are Get requests.
Similar to http-get, HTTP-POST parameters are also URL encoded. However, the name / value pair is not transmitted as part of the URL, but passed in the actual HTTP request message. For example, HTML page