HTTP - Message Examples
HTTP - Message Examples
tutorialspoint.com/http/http_message_examples.htm
Selected Reading
UPSC IAS Exams Notes
Developer's Best Practices
Questions and Answers
Effective Resume Writing
HR Interview Questions
Computer Glossary
Who is Who
Advertisements
Previous Page
Next Page
Example 1
HTTP request to fetch hello.htm page from the web server running on tutorialspoint.com.
Client request
Server response
1/4
HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Last-Modified: Wed, 22 Jul 2009 19:15:56 GMT
Content-Length: 88
Content-Type: text/html
Connection: Closed
<html>
<body>
<h1>Hello, World!</h1>
</body>
</html>
Example 2
HTTP request to fetch t.html page that does not exist on the web server running on
tutorialspoint.com.
Client request
Server response
<head>
<title>404 Not Found</title>
</head>
<body>
<h1>Not Found</h1>
<p>The requested URL /t.html was not found on this server.</p>
</body>
</html>
2/4
Example 3
HTTP request to fetch hello.htm page from the web server running on tutorialspoint.com,
but the request goes with an incorrect HTTP version:
Client request
Server response
<head>
<title>400 Bad Request</title>
</head>
<body>
<h1>Bad Request</h1>
<p>Your browser sent a request that this server could not understand.<p>
<p>The request line contained invalid characters following the protocol string.
<p>
</body>
</html>
Example 4
HTTP request to post form data to process.cgi CGI page on a web server running on
tutorialspoint.com. The server returns the passed name after setting them as cookies:
Client request
3/4
POST /cgi-bin/process.cgi HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Content-Type: text/xml; charset=utf-8
Content-Length: 60
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive
first=Zara&last=Ali
Server response
HTTP/1.1 200 OK
Date: Mon, 27 Jul 2009 12:28:53 GMT
Server: Apache/2.2.14 (Win32)
Content-Length: 88
Set-Cookie: first=Zara,last=Ali;domain=tutorialspoint.com;Expires=Mon, 19-
Nov-2010 04:38:14 GMT;Path=/
Content-Type: text/html
Connection: Closed
<html>
<body>
<h1>Hello Zara Ali</h1>
</body>
</html>
Advertisements
4/4