100 likes | 317 Views
HTTP. HyperText Transfer Protocol. HTTP. Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information about the clients) Text-based protocol Two types of messages: Request messages Response messages. Web pages.
E N D
HTTP HyperTextTransferProtocol
HTTP • Uses TCP as its underlying transport protocol • Uses port 80 • Stateless protocol (i.e. HTTP Server maintains no information about the clients) • Text-based protocol • Two types of messages: • Request messages • Response messages
Web pages • Web pages consist of objects (HTML files, images etc.) • Web pages are addressable by a single URL Example A web page that consists of an HTML file and 5 images, has 6 objects. images. The base HTML file references the other objects in the page with the objects' URLs.
URLs Each URL has two components: • The host name of the server that houses the object • The objects path name www.someSchool.edu/someDepartment/page.html Host name Path name
HTTP Request Messages GET /somedir/page.html HTTP/1.1 Connection: close User-agent: Mozilla/4.0 Accept: text/html, image/gif, image/jpeg <<extra blank line (carriage return) >> (other types of request messages include POST and HEAD messages)
HTTP Response Messages HTTP/1.1 200 OK Connection: close Date: Thu, 06 Aug 1998 12:00:15 GMT Server: Apache/1.3.0 (Unix) Last-Modified: Mon, 22 Jun 1988 09:23:23 HMT Content-Length: 6821 Content-Type: text/html data data data data data
Status Codes • 200 OK • 301 Moved Permanently • 400 Bad Request • 404 Not Found • 505 HHTP Version Not Supported • etc.