Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
PART 6 Application Layer
Kyung Hee University 1 1 Application Layer. 2 Kyung Hee University Position of Application Layer.
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Hypertext Transfer Protocol Kyle Roth Mark Hoover.
Layer 7- Application Layer
World Wide Web1 Applications World Wide Web. 2 Introduction What is hypertext model? Use of hypertext in World Wide Web (WWW) – HTML. WWW client-server.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Know how HTTP accesses data on the WWW Objectives.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
 What is it ? What is it ?  URI,URN,URL URI,URN,URL  HTTP – methods HTTP – methods  HTTP Request Packets HTTP Request Packets  HTTP Request Headers.
HTTP; The World Wide Web Protocol
Chapter 1: Introduction to Web
FTP (File Transfer Protocol) & Telnet
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
CP476 Internet Computing Lecture 5 : HTTP, WWW and URL 1 Lecture 5. WWW, HTTP and URL Objective: to review the concepts of WWW to understand how HTTP works.
TCP/IP Protocol Suite 1 Chapter 22 Upon completion you will be able to: World Wide Web: HTTP Understand the components of a browser and a server Understand.
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Copyright (c) 2010, Dr. Kuanchin Chen1 The Client-Server Architecture of the WWW Dr. Kuanchin Chen.
Kingdom of Saudi Arabia Ministry of Higher Education Al-Imam Muhammad Ibn Saud Islamic University College of Computer and Information Sciences Chapter.
1 WWW. 2 World Wide Web Major application protocol used on the Internet Simple interface Two concepts –Point –Click.
McGraw-Hill©The McGraw-Hill Companies, Inc., 2004 Chapter 27 HTTP and WWW.
2: Application Layer 1 Chapter 2: Application layer r 2.1 Principles of network applications  app architectures  app requirements r 2.2 Web and HTTP.
CITA 310 Section 2 HTTP (Selected Topics from Textbook Chapter 6)
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
Week 11: Application Layer 1 Web and HTTP r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,… r Web page consists.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 Chapter 22 World Wide Web (HTTP) Chapter 22 World Wide Web (HTTP) Mi-Jung Choi Dept. of Computer Science and Engineering
TCP/IP Protocol Suite 1 Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter 22 World Wide Web and HTTP.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
Chapter 26 Standard Client-Server Protocols
4.01 How Web Pages Work.
Hypertext Transfer Protocol
Remote Logging, Electronic Mail, and File Transfer
Block 5: An application layer protocol: HTTP
How HTTP Works Made by Manish Kushwaha.
Section 6.3 Server-side Scripting
WWW and HTTP King Fahd University of Petroleum & Minerals
HTTP – An overview.
Hypertext Transfer Protocol
Networking CS 3470, Section 1 Sarah Diesburg
Web Development Web Servers.
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Hypertext Transport Protocol
Internet transport protocols services
CASE STUDY -HTML,URLs,HTTP
Net 431 D: ADVANCED COMPUTER NETWORKS
Web Development & Design Chapter 1, Sections 4, 5 & 6
IS333D: MULTI-TIER APPLICATION DEVELOPMENT
Computer Communication & Networks
Chapter 27 WWW and HTTP.
Application layer Lecture 7.
Net431:advanced net services
Networking CS 3470, Section 1 Sarah Diesburg
HyperText Transfer Protocol
EE 122: HyperText Transfer Protocol (HTTP)
Hypertext Transfer Protocol (HTTP)
William Stallings Data and Computer Communications
Lecture 5: Functions and Parameters
PART 6 Application Layer
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Kevin Harville Source: Webmaster in a Nutshell, O'Rielly Books
HTTP Hypertext Transfer Protocol
4.01 How Web Pages Work.
Presentation transcript:

Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.

Topics discussed in this section: 27-3 HTTP The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web. HTTP functions as a combination of FTP and SMTP. Topics discussed in this section: HTTP Transaction Persistent Versus Non persistent Connection

HTTP uses the services of TCP on well-known port 80. Note HTTP uses the services of TCP on well-known port 80.

Figure 27.12 HTTP transaction

Figure 27.13 Request and response messages

Figure 27.14 Request and status lines

Table 27.1 Methods A head does not require the server to send us the content of the requested file, but simply an acknowledgement that the file is available. The GET will request the complete file from the server

Table 27.2 Status codes

Table 27.2 Status codes (continued)

Figure 27.15 Header format

Table 27.3 General headers

Table 27.4 Request headers

Table 27.5 Response headers

Table 27.6 Entity headers

Example 27.1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in the GIF or JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Figure 27.16).

Figure 27.16 Example 27.1

MIME (Multi-Purpose Internet Mail Extensions) * MIME (Multi-Purpose Internet Mail Extensions) is an extension of the original Internet e-mail protocol that lets people use the protocol to exchange different kinds of data files on the Internet: audio, video, images, application programs, and other kinds, as well as the ASCII text Servers insert the MIME header at the beginning of any Web transmission. Clients use this content type or media type header to select an appropriate "player" application for the type of data the header indicates.

MIME * اختصار لمصطلح multipurpose internet mail extensions " حيث من المعروف أن اى رسالة إلكترونية تتكون من ثلاث اجزاء العنوان المرسل إليه وبشكل تلقائى البريد الإلكترونى للراسل ثم موضوع الرسالة التى سوف يتم إرسالها هذا بالإضافة إلى الجزء الخاص بالنص او محتوى الرسالة وهذا هو الشكل المعتاد فى خدمات البريد الإلكترونى المختلفة على الأنترنت . بالإضافة إلى ما سبق يمكنك أيضاً ارفاق ملفات مثل الصور , الفيديوهات , ملفات العمل الى غير ذالك من انواع الملفات التى يمكن أن نرفقها فى الرسالة من هنا يظهر معنى MIME وهو شكل او امتداد للملفات المرفقة مع الرسالة وبالتالى أسهل وسيلة لفتح هذه الملفات مجرد الضغط عليها بحيث تترك المجال لنظام التشغيل يقوم بتشغيلها طبقاً للتطبيق الداعم لنوعية الملف .

Example 27.2 In this example, the client wants to send data to the server. We use the POST method. The request line shows the method (POST), URL, and HTTP version (1.1). There are four lines of headers. The request body contains the input information. The response message contains the status line and four lines of headers. The created document, which is a CGI document, is included as the body (see Figure 27.17).

Figure 27.17 Example 27.2

Common Gateway Interface * The common gateway interface (CGI) is a standard way for a Web server to pass a Web user's request to an application program and to receive data back to forward to the user. When the user requests a Web page (for example, by clicking on a highlighted word or entering a Web site address), the server sends back the requested page.

Common Gateway Interface * However, when a user fills out a form on a Web page and sends it in, it usually needs to be processed by an application program. The Web server typically passes the form information to a small application program that processes the data and may send back a confirmation message. This method or convention for passing data back and forth between the server and the application is called the common gateway interface (CGI). It is part of the Web's Hypertext Transfer Protocol (HTTP).

Common Gateway Interface *

HTTP version 1.1 specifies a persistent connection by default. Note HTTP version 1.1 specifies a persistent connection by default.

Persistent vs non-persistent HTTP connections default for HTTP/1.1 on same TCP connection: server, parses request, responds, parses new request,.. less slow start. HTTP/1.0 server parses request, responds, and closes TCP connection Each object transfer suffers from slow start

Example 1 Where will each figure be shown on the screen? Look at the following picture: then tell me what you feel: <IMG SRC="PictureslFunnyl.gif" ALIGN=middle> <lMG SRC="Pictures/Funny2.gif" ALIGN=bottom> <B>What is your feeling? <IE>

Example #1 ,Ans The first picture will be centered and the second will be at the bottom.

Script* In the dawn of the Internet revolution, web pages were HTML based – they looked good, but could not provide the rich functionality that we are used to today. This is the time when scripting languages  Scripts are invisible to the visitor's eye but their availability within the code of a website defines how the website behaves in response to certain click requests sent by the user

Script * In computer programming, a script is a program or sequence of instructions that is interpreted or carried out by another program rather than by the computer processor(as a compiled program is). Some languages have been conceived expressly as script languages. Among the most popular are Perl, PHP   JavaScript. A script is sometimes used to mean a list of operating system commands that are prestored in a file and performed sequentially by the operating system's command interpreter

What are JavaScript, PHP and Perl? * Since the HTML/CSS combination is analogous to the data found in a Word document, it is good only for displaying information. If you want your web pages to do different things depending on the situation, you will need a programming language. For example, some websites want to provide a membership facility where people can log into the site, and access certain information. Other sites provide a feedback form so that visitors can contact them. All these things require facilities that a simple document format cannot do. JavaScript, PHP and Perl are three of the most commonly-used programming languages on the Internet. They are used by websites to carry out more complicated operations.

Client site script * Programs written in JavaScript run in the web browser itself, so if your website has a JavaScript program, the program will be automatically fetched by your visitor's browser and executed on his/her computer.

Example of java script * For more info visit : http://www.w3schools.com/js/js_intro.asp

Server site script * PHP and Perl programs, on the other hand, run on the computer where your website is located, that is, on your web host's computer. After the PHP or Perl program does what it needs to do, it sends the result to the visitor's web browser, which displays the results. For more info visit : http://www.w3schools.com/php/php_intro.asp

Example 2 2. Show a request that retrieves the document /usr/users/doc/doc1. Use : at least two general headers, two request headers, and one entity header.

Example #2 ,Ans GET /usr/users/doc/doc.1 HTTP /1.1 Date: Fri, 13-Jan-06 08:45:20 GMT MIME-version: 1.0 Accept: image/gif Accept: image/jpeg Last modified: Mon, 09-Jan-06

Example 3 3. Show the response to Exercise 2 for a successful request

Example #3 ,Ans HTTP/1.1 200 OK Date: Fri, 13-Jan-06 08:45:25 GMT Server: Challenger MIME-version: 1.0 Content-length: 4623 (Body of document)

Example 4 4. Show the response to Exercise 2 for a document that has permanently moved to /usr/deads/doc1.

Example #4 ,Ans HTTP/1.1 302 Moved permanently Date: Fri, 13-Jan-06 08:45:25 GMT Server: Challenger Location: /usr/deads/doc.1

Example 5 5. Show the response to Exercise 2 if there is a syntax error in the request.

Example #5 ,Ans HTTP/1.1 400 Bad Request Date: Fri, 13-Jan-06 08:45:25 GMT Server: Challenger

Example 6 6. Show the response to Exercise 2 if the client is unauthorized to access the document

Example #6 ,Ans HTTP/1.1 401 Unauthorized Date: Fri, 13-Jan-06 08:45:25 GMT Server: Challenger

Example 7 7. Show a request that asks for information about a document at /bin/users/file. Use at least: two general headers and one request header.

Example #7 ,Ans HEAD /bin/users/file HTTP /1.1 Date: Fri, 13-Jan-06 10:40:22 GMT MIME-version: 1.0 From: mzzchen@sinonet.cn

Example 8 8. Show the request to copy the file at location /bin/usr/bin/file1 to /bin/file1. Use at least: two general headers and one entity header.

9. Show the response to Exercise 8, for a successful request. Example 9 9. Show the response to Exercise 8, for a successful request.