IS333D: MULTI-TIER APPLICATION DEVELOPMENT

Slides:



Advertisements
Similar presentations
PHP syntax basics. Personal Home Page This is a Hypertext processor It works on the server side It demands a Web-server to be installed.
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.
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.
Web Servers How do our requests for resources on the Internet get handled? Can they be located anywhere? Global?
 2002 Prentice Hall. All rights reserved. 1 Chapter 6 – Introduction to the Common Gateway Interface (CGI) Outline 6.1 Introduction 6.2 Client and Web.
 2008 Pearson Education, Inc. All rights reserved Web Servers (IIS and Apache)
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
1 The World Wide Web. 2  Web Fundamentals  Pages are defined by the Hypertext Markup Language (HTML) and contain text, graphics, audio, video and software.
Hypertext Transport Protocol CS Dick Steflik.
17 Web Servers (Apache and IIS)
1 Web Servers (IIS and Apache) Outline 9.1 Introduction 9.2 HTTP Request Types 9.3 System Architecture 9.4 Client-Side Scripting versus Server-Side Scripting.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application Introducing Visual Web Developer 2008 Express and the.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
1 Web Server Concepts Dr. Awad Khalil Computer Science Department AUC.
FTP (File Transfer Protocol) & Telnet
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
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.
5 Chapter Five Web Servers. 5 Chapter Objectives Learn about the Microsoft Personal Web Server Software Learn how to improve Web site performance Learn.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 21 - Web Servers (IIS, PWS and Apache) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3.
1 Web Servers (Chapter 21 – Pages( ) Outline 21.1 Introduction 21.2 HTTP Request Types 21.3 System Architecture.
Chapter 29 World Wide Web & Browsing World Wide Web (WWW) is a distributed hypermedia (hypertext & graphics) on-line repository of information that users.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Internet & World Wide Web How to Program, 5/e. © by Pearson Education, Inc. All Rights Reserved.2 Revised by Dr. T. Tran for CSI3140.
 2008 Pearson Education, Inc. All rights reserved. Chapter 17 Web Servers (Apache and IIS) Internet & World Wide Web How to Program, 5/e.
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1 Fundamentals.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
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.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Overview of Servlets and JSP
Data Communications and Computer Networks Chapter 2 CS 3830 Lecture 7 Omar Meqdadi Department of Computer Science and Software Engineering University of.
COMP2322 Lab 2 HTTP Steven Lee Jan. 29, HTTP Hypertext Transfer Protocol Web’s application layer protocol Client/server model – Client (browser):
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Simple Web Services. Internet Basics The Internet is based on a communication protocol named TCP (Transmission Control Protocol) TCP allows programs running.
Copyright © 2011 Pearson Addison-Wesley Web Servers and Projects Deployment Chapter 11 – Slide 1.
National College of Science & Information Technology.
Tiny http client and server
Block 5: An application layer protocol: HTTP
How HTTP Works Made by Manish Kushwaha.
WWW and HTTP King Fahd University of Petroleum & Minerals
HTTP – An overview.
The Hypertext Transfer Protocol
Web Development Web Servers.
Warm Handshake with Websites, Servers and Web Servers:
Computing with C# and the .NET Framework
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Browsing and Searching the Web
Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
E-commerce | WWW World Wide Web - Concepts
Chapter 19 PHP Part III Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Hypertext Transport Protocol
E-commerce | WWW World Wide Web - Concepts
Tutorial (4): HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Computer Communication & Networks
17 Web Servers (Apache and IIS)
Client side & Server side scripting
HyperText Transfer Protocol
EE 122: HyperText Transfer Protocol (HTTP)
17 Web Servers (Apache and IIS)
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
The HTTP Protocol COSC 2206 Internet Tools The HTTP Protocol
WEB SERVICES From Chapter 19, Distributed Systems
HTTP Hypertext Transfer Protocol
Web Servers (IIS and Apache)
* Web Servers/Clients * The HTTP Protocol
Presentation transcript:

IS333D: MULTI-TIER APPLICATION DEVELOPMENT Lecture 5: HTTP

Information Systems Department Objectives To provide an overview of how the HTTP works in the context of a simple page request. To learn about client-side caching. To know how to access to a web server. 21-Sep-18 Information Systems Department

Information Systems Department HTTP The hypertext transport protocol (HTTP) defines a simple series of procedures by which a client computer may make a request of a server computer, and the server computer may reply. The protocol is central to the everyday operation of the World Wide Web, in which it is used to request and provide files to browsers in response to URL entries and clicks on hyperlinks. 21-Sep-18 Information Systems Department

Information Systems Department HTTP: Part of a URL A URL contains information that directs a browser to the resource that the user wishes to access. Web servers make such resources available to web clients. Let’s examine the component of the URL: http://www.deitel.com/books/downloads.html 21-Sep-18 Information Systems Department

Information Systems Department HTTP: Part of a URL http:// Indicates that the HyperText Transfer Protocol (HTTP) should be used to obtain the resource. www.deitel.com Hostname – the name of the web server computer on which the resource resides. This computer is referred to as the host, because it houses and maintain resources. 21-Sep-18 Information Systems Department

Information Systems Department HTTP: Part of a URL books/downloads.htm Specifies the resource’s location (/book) and name (downloads.html) on the web server 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response The one making a request is the HTTP client and the one responding to that request is the HTTP server. When given a web page URL, a web browser uses HTTP to request the web page found at that address. 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response a) The request is sent from the web client to the web server Internet Web Client Web Server b) After it receives the request, the web server searches its system for the resource Fig 1. A web browser sending a GET request to a web server 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response Fig. 1 shows the GET request. The web browser sends an HTTP request to the server. The request (in its simplest form) is: GET /books/downloads.html HTTP/1.1 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response GET is an HTTP method indicating that the client wishes to obtain a resource from the server. The remainder of the request provides the path name of the resource (e.g., an HTML5 document) and the protocol’s name and version number (HTTP/1.1). The client’s request also contains some required and optional headers. There is a blank line at the end of an HTTP GET request to terminate the header. 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response Internet Web Client Web Server The server responds to the request with the resource’s contents Fig 2. A web server replying the HTTP respond to a web client 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response Any server that understands HTTP (version 1.1) can translate the request and respond appropriately. Fig. 2 shows the web server responding to a request. The server first sends a line of text that indicates the HTTP version, followed by a numeric code and a phrase describing the status of the transaction. Eg.: HTTP/1.1 200 OK, which indicates success 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response E.g.: HTTP/1.1 404 Not found, which informs the client that the web server could not locate the requested resource. A complete list of numeric codes can be found at www.w3.org/Protocols/rfc2616/rfc2616-sec10.html Each series of response codes corresponds to a particular class of conditions: 200-series codes indicate success. 300-series codes indicate a redirection to a new URL. 400-series codes indicate a client-side error (like a request for a nonexistent document—the famous “404 Not Found” error). 500-series codes indicate a server-side error. 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response Next, the server sends one or more HTTP headers, which provide additional information about the data that will be sent. In this case, the server is sending an HTML5 text document, so one HTTP header for this example would read: Content-type: text/html 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response The information provided in the header specifies the Multipurpose Internet Mail Extension (MIME) type of the content that the server is transmitting to the browser. The MIME standard specifies data formats, which programs can use to interpret data correctly. Other MIME example: text/plain – text content that can be displayed directly image/jpeg – JPEG image content 21-Sep-18 Information Systems Department

Making a Request and Receiving a Response The header or set of headers is followed by a blank line, which indicates to the client browser that the server is finished sending HTTP headers. Finally, the server sends the contents of the requested document (downloads.html). 21-Sep-18 Information Systems Department

Anatomy of an HTTP Transaction When a user of a browser enters a URL or clicks a link: http://www.aol.com 21-Sep-18 Information Systems Department

Anatomy of an HTTP Transaction GET / HTTP/1.1 Client: request line host: www.aol.com Client: required HTTP/1.1 HOST header Client: blank line terminates headers. HTTP/1.0 200 OK Server: response line MIME-Version: 1.0 Server: followed by five response headers Date: Mon, 08 Jan 2001 04:59:42 GMT Server: NaviServer/2.0 AOLserver/2.3.3 Content-Type: text/html Server: expect HTML in the response body Content-Length: 42092 Server: expect 42,092 bytes in the resp. body Server: blank line terminates headers <html> Server: first HTML line in response body ... Server: 766 lines of HTML not shown. </html> Server: last HTML line in response body Connection closed by foreign host. Server: closes connection 21-Sep-18 Information Systems Department

Information Systems Department Request Method Two most common HTTP request types: GET POST A GET request typically gets (or retrieves) information from a server, such as an HTML document, an image or search results based on a user-submitted search term. A POST request typically posts (or sends) data to a server. Common use of post requests are to send form data or documents to a server. 21-Sep-18 Information Systems Department

Information Systems Department Request Method (Cont.) An HTTP request often posts data to a server-side form handler that processes the data. For example, when a user performs a search or participates in a web-based survey, the web server receives the information specified in the HTML form as part of the request. Get and post requests can both be used to send data to a web server, but each request type sends the information differently. 21-Sep-18 Information Systems Department

Information Systems Department Using GET Request A GET request appends data to the URL, e.g., www.google.com/search?q=deitel. In this case, search is the name of Google’s server-side form handler, q is the name of a variable in Google’s search form and deitel is the search term. The ? in the preceding URL separates the query string from the rest of the URL in a request. A name/value pair is passed to the server with the name and the value separated by an equals sign (=). 21-Sep-18 Information Systems Department

Using GET Request (Cont.) If more than one name/value pair is submitted, each pair is separated by an ampersand (&). The server uses data passed in a query string to retrieve an appropriate resource from the server. The server then sends a response to the client. A GET request may be initiated by submitting an HTML form whose method attribute is set to “get”, or by typing the URL (containing a query string) directly into the browser’s address bar. 21-Sep-18 Information Systems Department

Information Systems Department Using POST Request A POST request sends form data as part of the HTTP message, not as part of the URL. The POST method can send large amount of information. The POST method is sometimes preferred because it hides the submitted data from the user by embedding it in an HTTP message. URL generated by the POST method: www.google.com/search 21-Sep-18 Information Systems Department

Information Systems Department Client-Side Caching Browsers often cache (save on disk) recently viewed web pages for quick reloading. If there are no changes between the version stored in the cache and the current version on the web, this speeds up your browsing experience. An HTTP response can indicate the length of time for which the content remains “fresh”. If this amount of time has not been reached, the browser can avoid another request to the server. 21-Sep-18 Information Systems Department

Client-Side Caching (Cont.) If not, the browser loads the document from the cache. Similarly, there’s also the “not modified” HTTP response, indicating that the file content has not changed since it was last requested. Browsers typically do not cache the server’s response to a POST request, because the next POST might not return the same result. 21-Sep-18 Information Systems Department

Information Systems Department Accessing Web Server To request documents from web servers, users must know the hostnames on which the web server software resides. Users can request documents from local web servers (i.e., ones residing on users’ machines) or remote web servers (i.e., ones residing on different machines). 21-Sep-18 Information Systems Department

Accessing Web Server (Cont.) Local web servers can be accessed through your computer’s name or through the name localhost – a hostname that references the local machine and normally translate to the IP address 127.0.0.1. A remote web server referenced by a fully qualified hostname or an IP address can also serve documents. E.g.: http://www.deitel.com/books/downloads.html, the www.deitel.com is the server’s fully qualified hostname. 21-Sep-18 Information Systems Department

Accessing Web Server (Cont.) Example of web server software: Apache IIS (Microsoft Internet Information Services) Orion 21-Sep-18 Information Systems Department

Information Systems Department References Multi-tier Application Programming with PHP, Practical Guide for Architect and Programmer, David Wall, 1st Edition Internet and World Wide Web How To Program, Deitel, Deitel & Deitel, 5th Edition (Chapter 17) 21-Sep-18 Information Systems Department