Servlet Example: Showing Request Headers
Request Method: GETRequest URI: /servlet/ShowRequestHeaders.do
Request Protocol: HTTP/1.1
Header Name | Header Value | ||
---|---|---|---|
host | localhost:8080 | ||
connection | keep-alive | ||
user-agent | Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.79 Safari/537.4 | ||
accept | text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 | ||
accept-encoding | gzip,deflate,sdch //Gzip is a text compression scheme that can dramatically reduce the size of HTML | ||
accept-language | en-US,en;q=0.8 | ||
accept-charset | ISO-8859-1,utf-8;q=0.7,*;q=0.3 | ||
cookie | email=charlesxieyupeng%40gmail.com |
E.X.
GET /servlet/Search?keywords=servlets+jsp HTTP/1.1
Accept : image/gif, image/jpg, */*
Accept-Encoding: gzip
Connection: Keep-Alive
Cookie : userID=id456578
POST..
A typical response header
Status Code
• 100–199
Codes in the 100s are informational, indicating that the client should
respond with some other action.
• 200–299
Values in the 200s signify that the request was successful.
• 300–399
Values in the 300s are used for files that have moved and usually
include a Location header indicating the new address.
• 400–499
Values in the 400s indicate an error by the client.
• 500–599
Codes in the 500s signify an error by the server.
No comments:
Post a Comment