Example of Message in HTTP

Some examples of Message in HTTP make it easier for users to visualize.

Example 1

HTTP requests that the hello.htm page be removed from the server running on tutorialspoint.com .

Client requires:

  GET /hello.htm HTTP / 1.1 
User-Agent: Mozilla / 4.0 (compatible; MSIE5.01; Windows NT)
Host: www.tutorialspoint.com
Accept-Language: en-us
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Server responds:

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 

 

 Hello, World! 

Example 2

HTTP requests to remove t.html pages that do not exist on the server running on tutorialspoint.com.

Client requires:

GET / t.html HTTP/1.1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive

Server responds:

HTTP/1.1 404 Not Found Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Content-Type: text/html; charset=iso-8859-1 Connection: Closed 
 404 Not Found 

 

 Not Found 
 The requested URL /t.html was not found on this server. 

Example 3

HTTP requests that the hello.htm page be removed from the server running on tutorialspoint.com but the request comes with an incorrect HTTP version:

Client requires:

GET /hello.htm HTTP1 User-Agent: Mozilla/4.0 (compatible; MSIE5.01; Windows NT) Host: www.tutorialspoint.com Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive

Server responds:

HTTP/1.1 400 Bad Request Date: Sun, 18 Oct 2012 10:36:20 GMT Server: Apache/2.2.14 (Win32) Content-Length: 230 Content-Type: text/html; charset=iso-8859-1 Connection: Closed 
 400 Bad Request 

 

 Bad Request 
 Your browser sent a request that this server could not understand. 
 The request line contained invalid characters following the protocol string. 

Example 4

HTTP requests to send sample data to process.cgi page on a server running on tutorialspoint.com . The server returns the transferred name after setting them as cookies:

Client requires:

  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 responds:

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 

 

 Hello Zara Ali 

According to Tutorialspoint

Previous article: Security in HTTP

Next lesson: Installation instructions C

You've just finished reading the article "Example of Message in HTTP" edited by the TipsMake team. You can save example-of-message-in-http.pdf to your computer here to read later or print it out. We hope this article has provided you with many useful tech tips and tricks. You can search for similar articles on tips and guides. Thank you for reading and for following us regularly.

« PREV What is AngularJS?
NEXT » Security in HTTP