Presentation is loading. Please wait.

Presentation is loading. Please wait.

CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)

Similar presentations


Presentation on theme: "CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)"— Presentation transcript:

1 CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)

2 How a Web Server Works HTTP (Hypertext Transfer Protocol) defines how information is passed between a browser and a Web server. The two most popular Web servers are Apache from Apache Software Foundation Internet Information Services (IIS) from Microsoft The original Web server from Microsoft available on Windows NT was Internet Information Server

3 How a Web Server Works As is true with other servers such as DNS, Web servers listen for communication at a port. The default port is 80. You can also create Web servers at port numbers greater than 1023. Each Web server has a document root, which is where you store the HTML documents.

4 Understanding HTTP The current version of HTTP is 1.1. Virtually no browsers are so old that they do not support 1.1. HTTP is a stateless protocol, meaning that each Web page sent is independent of every other Web page sent. This makes it more challenging to create a shopping cart application.

5 Understanding HTTP HTTP 1.1 supports persistent connections. This allows the browser to receive multiple files in one TCP connection. This can speed up communication. Although you see a single page in your browser, it can be composed of many text and image files.

6 URL Generalized Syntax [scheme://] [username[:password]@] host[:port][/path] [?query][#fragment]

7 HTTP Request Example When the browser sends a request to a Web server, it looks like: GET /hello.htm HTTP/1.1 Host: www.technowidgets.com The above requests the hello.htm file from the document root of the Web server. It specifies the host of www.technowidgets.com. There could be multiple hosts at the IP address.

8 HTTP Methods GET HEAD POST PUT OPTIONS DELETE TRACE CONNECT

9 HTTP Response Example The following shows some of the headers along with the HTML that the Web server would send: HTTP/1.1 200 OK Server: Microsoft-IIS/6.0 Content-Type: text/html Last-Modified: Fri, 17 May 2008 18:21:25 GMT Content-Length: 43 Hello World! The headers contain information about the page

10 Sample HTTP Response Status Codes 200 OK request succeeded, requested object later in this message 301 Moved Permanently requested object moved, new location specified later in this message 400 Bad Request request message not understood by server 404 Not Found requested document not found on this server 505 HTTP Version Not Supported


Download ppt "CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)"

Similar presentations


Ads by Google