1 / 32

Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar

Internet Programming. Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar. H ypertext T ransfer P rotocol - HTTP. Contents. Introduction to HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1

Download Presentation

Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. InternetProgramming Lecture # 1 By: Aftab Alam Department Of Computer Science University Of Peshawar

  2. Hypertext Transfer Protocol- HTTP

  3. Contents Introduction to HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  4. Contents INTRODUCTION TO HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  5. 1.Introduction to HTTP HTTP stands for Hypertext Transfer Protocol. Used to transfer resources on the WWW. These resources could be HTML files Image files Query results etc

  6. 1.Introduction to HTTP (cont’d) A browser works as an HTTP client because it sends requests to an HTTP server which is called Web server. The Web Server then sends responses back to the client. The standard and default port for HTTP servers to listen on is 80.

  7. 1.Introduction to HTTP (cont’d) Three important things about HTTP. HTTP is connectionless. HTTP is media independent. (any data) HTTP is stateless.

  8. 1.Introduction to HTTP (cont’d)

  9. Contents Introduction to HTTP WHY IS HTTP SO POPULAR ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  10. 2. Why HTTP is so popular? It is the data transfer protocol standard used for the web. HTTP is simple and fast.

  11. Contents Introduction to HTTP Why is HTTP so popular ? DIFFERENT EVOLUTIONS OF HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  12. 3.Different evolutions of HTTP. HTTP 0.9 HTTP 1.0 HTTP 1.1

  13. 3. Different evolutions of HTTP. (Cont’d) HTTP 0.9 defined in 1992. Basic features: Request : Only 1 method supported in the request message (GET). Reply : Contains only HTML format. Only HTML documents are permitted (no other formats) Efficient and adapted when it was created but began quickly limited.

  14. 3. Different evolutions of HTTP. (Cont’d) HTTP 1.0 Published in RFC 1945. Improvements between these 2 versions Use the MIME type headers. Basic Authentication (no encryption). HTTP version number in the request message. Introduce metadata

  15. 3. Different evolutions of HTTP. (Cont’d) Problems with HTTP 0.9 and HTTP 1.0 Congestion (traffic jam) and high delay during the communication. Size of “get method” only a few thousand bit. Not enough security (basic authentication).

  16. 3. Different evolutions of HTTP. (Cont’d) Solution HTTP 1.1 Improve performance. New methods : delete, put, options, trace and connect.

  17. Contents Introduction to HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  18. 4. HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.2. HTTP 1.1 Server Response

  19. Contents Introduction to HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 Server Response 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  20. 4. HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request The HTTP request that the browser sends to the server contains 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body

  21. 4. HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request Example: GET/test.com/HTTP 1.1 Accept Language: en-us Connection: Keep-Alive Host: www.test.com Referer: http://test.com/index.php?id=10 User-Agent: Mozilla ( Linux 2.0.32 i586)

  22. 4. HTTP Protocol Version 1.1 4.1.1. HTTP Client Request Line Request line consist of three pieces of information. i. HTTP command known as method GET, POST, HEAD, PUT, DELETE, TRACE, OPTIONS, CONNECT ii. Path from the resources that the client is requesting. iii. The version numbers of HTTP (such as HTTP 1.1) Example GET/ yahoo.com HTTP/1.1

  23. 4. HTTP Protocol Version 1.1 4.1.2. HTTP Client Request Header HTTP request’s header contains information falls into three different categories. General Information. Information about either client or server. Entity Information. Information about the data being sent b/w client and server Request Information. Request information form the client.

  24. 4. HTTP Protocol Version 1.1 4.1.2. HTTP Client Request Header Example Accept Language: en-us Connection: Keep-Alive Host: www.test.com Referer: http://test.com/index.php?id=10 User-Agent: Mozilla

  25. 4. HTTP Protocol Version 1.1 4.1.3 HTTP Client Request Body If the post method is used in the HTTP request line, then the http request body contains data that is being send to the server.. For example. HTML form data.

  26. Contents Introduction to HTTP Why is HTTP so popular ? Different evolutions of HTTP. 3.1. HTTP 0.9, HTTP1.0 and HTTP 1.1 HTTP Protocol Version 1.1 4.1. HTTP 1.1 Client Request 4.1.1. HTTP Client Request Line 4.1.2. HTTP Client Request Header 4.1.3 HTTP Client Request Body 4.2 HTTP 1.1 SERVER RESPONSE 4.2.1. HTTP Server Response Line 4.2.2. HTTP Server Response Header 4.2.3 HTTP Server Response Body

  27. 4. HTTP Protocol Version 1.1 4.2. HTTP 1.1 Server Response The HTTP response is sent by the server back to the client and contains the following three things. 4.1.1. HTTP Server Response Line 4.1.2. HTTP Server Response Header 4.1.3 HTTP Server Response Body

  28. 4. HTTP Protocol Version 1.1 4.2. HTTP 1.1 Server Response Example HTTP 1.1 200 OK (status line) Date Fri, 8Oct 3009 2009 14:09:03GMT (General header) Server : Apache/5.0(Unix) PHP/5.0 (Response Header) Last modified Fri, 29th Oct 2009 14:09:03 GMT (Entity Header)

  29. 4. HTTP Protocol Version 1.1 4.1.1. HTTP Server Response Line Example: HTTP/1.1 200 ok Contains two bits of information. HTTP version number. HTTP request code Request code that reports the success or failure of the request. 100-199= Request is processed. 200-299=Request is successful. 300-399=Request failed because information has been removed. 400-499=Client Error( Incomplete request or impossible request) 500-599=Server Error( the request is valid but the server is not able to complete the request)

  30. 4. HTTP Protocol Version 1.1 4.1.2 HTTP Server Response Header Server response header consist of the following three types of information i General Information. Information about either client or server. ii Entity Information. Information about the data being sent b/w client and server iii. Response Information. Response information sending back to the client

  31. 4. HTTP Protocol Version 1.1 4.2.3 HTTP Server Response Body If the request is successful, the HTTP response body contains the HTML code. If unsuccessful the a failure code is sent.

  32. 5. References. RFC 2616 http://www.rfc-ditor.org/rfc/rfc2616.txt

More Related