HTTP Requests
All HTTP messages (requests and responses) consist of one or more headers, each on a separate line, followed by a mandatory blank line, followed by an optional message body.
GET /books/search.asp?q=wahh HTTP/1.1Accept: image/gif, image/xxbitmap, image/jpeg, image/pjpeg, application/xshockwaveflash, application/vnd.msexcel, application/vnd.mspowerpoint, application/msword, */*Referer: http://wahh-app.com/books/default.aspAccept-Language: en-gb,en-us;q=0.5Accept-Encoding: gzip, deflateUser-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)Host: wahh-app.comCookie: lang=en; JSESSIONID=0000tI8rk7joMx44S2Uu85nSWc_:vsnlc502
The first line of every HTTP request consists of three items, separated by spaces:
- A verb indicating the HTTP method. The most commonly used method is GET, whose function is to retrieve a resource from the web server.
- The requested URL.
- The HTTP version being used. The only HTTP versions in common use on the Internet are 1.0 and 1.1.
HTTP Responses
A typical HTTP response is as follows:
HTTP/1.1 200 OKDate: Sat, 19 May 2007 13:49:37 GMTServer: IBM_HTTP_SERVER/1.3.26.2 Apache/1.3.26 (Unix)Set-Cookie: tracking=tI8rk7joMx44S2Uu85nSWcPragma: no-cacheExpires: Thu, 01 Jan 1970 00:00:00 GMTContent-Type: text/html;charset=ISO-8859-1Content-Language: en-USContent-Length: 24246charset=iso-8859-1”>...The first line of every HTTP response consists of three items, separated by spaces:
- The HTTP version being used.
- A numeric status code indicating the result of the request.
- A textual “reason phrase” further describing the status of the response.
Hiç yorum yok:
Yorum Gönder