HTTP Protocol HTTP Methods Name Description GET The

  • Slides: 10
Download presentation
HTTP Protocol

HTTP Protocol

HTTP Methods Name Description GET The GET method is used to retrieve information from

HTTP Methods Name Description GET The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data. HEAD Same as GET, but it transfers the status line and the header section only. POST A POST request is used to send data to the server, for example, customer information, file upload, etc. using HTML forms. PUT Replaces all the current representations of the target resource with the uploaded content. DELETE Removes all the current representations of the target resource given by URI. CONNECT Establishes a tunnel to the server identified by a given URI. OPTIONS Describe the communication options for the target resource. TRACE Performs a message loop back test along with the path to the target resource.

HTTP Status-Codes Code Description 1 xx Informational It means the request was received and

HTTP Status-Codes Code Description 1 xx Informational It means the request was received and the process is continuing 2 xx Success It means the action was successfully received, understood, and accepted 3 xx Redirection It means further action must be taken in order to complete the request 4 xx Client Error It means the request contains incorrect syntax or cannot be fulfilled 5 xx Server Error It means the server failed to fulfill an apparently valid request

Protocol Structure in Google Chrome

Protocol Structure in Google Chrome

HTTP Request Example (GET Method) GET http: //tpu. ru/img/tom. gif HTTP/1. 1 Accept: */*

HTTP Request Example (GET Method) GET http: //tpu. ru/img/tom. gif HTTP/1. 1 Accept: */* Referer: http: //tpu. ru/ User-Agent: Mozilla/4. 0 (compatible; MSIE 6. 0; Windows NT 5. 1) Host: tpu. ru Connection: close (empty line) GET /img/tom. gif HTTP/1. 1 Host: tpu. ru (empty line)

HTTP Request Example (POST Method) POST /cgi-bin/process. cgi HTTP/1. 1 User-Agent: Mozilla/4. 0 (compatible;

HTTP Request Example (POST Method) POST /cgi-bin/process. cgi HTTP/1. 1 User-Agent: Mozilla/4. 0 (compatible; MSIE 5. 01; Windows NT) Host: aics. ru Content-Type: application/x-www-form-urlencoded Content-Length: length Accept-Language: en-us Accept-Encoding: gzip, deflate Connection: Keep-Alive license. ID=string&content=string&/params. XML=string

HTTP Response Example HTTP/1. 1 200 OK Date: Mon, 27 Jul 2009 12: 28:

HTTP Response Example HTTP/1. 1 200 OK Date: Mon, 27 Jul 2009 12: 28: 53 GMT Server: Apache/2. 2. 14 (Win 32) Last-Modified: Wed, 22 Jul 2009 19: 15: 56 GMT Content-Length: 88 Content-Type: text/html Connection: Closed <html> <body> <h 1>Hello, World!</h 1> </body> </html>

SMTP Simple Mail Transfer Protocol

SMTP Simple Mail Transfer Protocol

SMTP Commands Command name Description HELO Introduce yourself MAIL FROM: Specify the sender RCPT

SMTP Commands Command name Description HELO Introduce yourself MAIL FROM: Specify the sender RCPT TO: Specify the recipient DATA Specify the body of the message (To, From and Subject should be the first three lines) RSET Reset QUIT Quit the session HELP Get help command VRFY Verify an address