Chapter 27 Hypertext Transfer Protocol



Similar documents
World Wide Web. Before WWW

1. When will an IP process drop a datagram? 2. When will an IP process fragment a datagram? 3. When will a TCP process drop a segment?

Internet Technologies. World Wide Web (WWW) Proxy Server Network Address Translator (NAT)

Protocolo HTTP. Web and HTTP. HTTP overview. HTTP overview

HTTP. Internet Engineering. Fall Bahador Bakhshi CE & IT Department, Amirkabir University of Technology

Outline Definition of Webserver HTTP Static is no fun Software SSL. Webserver. in a nutshell. Sebastian Hollizeck. June, the 4 th 2013

HTTP Protocol. Bartosz Walter

reference: HTTP: The Definitive Guide by David Gourley and Brian Totty (O Reilly, 2002)

WHAT IS A WEB SERVER?

The Hyper-Text Transfer Protocol (HTTP)

People Data and the Web Forms and CGI CGI. Facilitating interactive web applications

Network Technologies

Computer Networks. Lecture 7: Application layer: FTP and HTTP. Marcin Bieńkowski. Institute of Computer Science University of Wrocław

The Web: some jargon. User agent for Web is called a browser: Web page: Most Web pages consist of: Server for Web is called Web server:

By Bardia, Patit, and Rozheh

The Web History (I) The Web History (II)

CONTENT of this CHAPTER

URLs and HTTP. ICW Lecture 10 Tom Chothia

Web Services April 21st, 2009 with Hunter Pitelka

ICT 6012: Web Programming

The World Wide Web: History

Project #2. CSE 123b Communications Software. HTTP Messages. HTTP Basics. HTTP Request. HTTP Request. Spring Four parts

Internet Technologies Internet Protocols and Services

Fachgebiet Technische Informatik, Joachim Zumbrägel

Data Communication I

Web Programming. Robert M. Dondero, Ph.D. Princeton University

10. Java Servelet. Introduction

1 Introduction: Network Applications

Transport Layer Security Protocols

CS640: Introduction to Computer Networks. Applications FTP: The File Transfer Protocol

Computer Networks 1 (Mạng Máy Tính 1) Lectured by: Dr. Phạm Trần Vũ MEng. Nguyễn CaoĐạt

The World-Wide Web Gateway to Hyper-G: Using a Connectionless Protocol to Access Session-Oriented Services

TCP/IP Networking An Example

APACHE HTTP SERVER 2.2.8

Internet Information TE Services 5.0. Training Division, NIC New Delhi

Evolution of the WWW. Communication in the WWW. WWW, HTML, URL and HTTP. HTTP Abstract Message Format. The Client/Server model is used:

Web. Services. Web Technologies. Today. Web. Technologies. Internet WWW. Protocols TCP/IP HTTP. Apache. Next Time. Lecture # Apache.

M3-R3: INTERNET AND WEB DESIGN

Introduction to Computer Security

Web Application Development

WWW. World Wide Web Aka The Internet. dr. C. P. J. Koymans. Informatics Institute Universiteit van Amsterdam. November 30, 2007

Domain Name System (DNS)

Hypertext for Hyper Techs

No. Time Source Destination Protocol Info HTTP GET /ethereal-labs/http-ethereal-file1.html HTTP/1.

Lektion 2: Web als Graph / Web als System

Exercises: FreeBSD: Apache and SSL: pre SANOG VI Workshop

Internet Technologies_1. Doc. Ing. František Huňka, CSc.

Evolution of the WWW. Communication in the WWW. WWW, HTML, URL and HTTP. HTTP - Message Format. The Client/Server model is used:

7 Why Use Perl for CGI?

CTIS 256 Web Technologies II. Week # 1 Serkan GENÇ

CREATING WEB PAGES USING HTML INTRODUCTION

CGI An Example. CGI Model (Pieces)

The Application Layer. CS158a Chris Pollett May 9, 2007.

CloudOYE CDN USER MANUAL

Instructor: Betty O Neil

Cyber Security Workshop Ethical Web Hacking

THE PROXY SERVER 1 1 PURPOSE 3 2 USAGE EXAMPLES 4 3 STARTING THE PROXY SERVER 5 4 READING THE LOG 6

Connecting with Computer Science, 2e. Chapter 5 The Internet

COMP 112 Assignment 1: HTTP Servers

Modern Web Development From Angle Brackets to Web Sockets

Dynamic Content. Dynamic Web Content: HTML Forms CGI Web Servers and HTTP

Web Security (SSL) Tecniche di Sicurezza dei Sistemi 1

Project Report on Implementation and Testing of an HTTP/1.0 Webserver

Internet infrastructure

Introduction to LAN/WAN. Application Layer (Part II)

Basic Internet programming Formalities. Hands-on tools for internet programming

Table of Contents. Open-Xchange Authentication & Session Handling. 1.Introduction...3

How To Understand The History Of The Web (Web)

CSC 551: Web Programming. Spring 2004

INT322. By the end of this week you will: (1)understand the interaction between a browser, web server, web script, interpreter, and database server.

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

ICANWK414A Create a common gateway interface script


HTTP Caching & Cache-Busting for Content Publishers

Nuance Mobile Developer Program. HTTP Services for Nuance Mobile Developer Program Clients

1. Overview of the Java Language

APACHE WEB SERVER. Andri Mirzal, PhD N

Streaming Stored Audio & Video

Application Layer: HTTP and the Web. Srinidhi Varadarajan

1. Introduction. 2. Web Application. 3. Components. 4. Common Vulnerabilities. 5. Improving security in Web applications

Security-Assessment.com White Paper Leveraging XSRF with Apache Web Server Compatibility with older browser feature and Java Applet

2- Electronic Mail (SMTP), File Transfer (FTP), & Remote Logging (TELNET)

Application layer Web 2.0

Introduction to Internet and WWW

TCP/IP and the Internet

S y s t e m A r c h i t e c t u r e

HOST EUROPE CLOUD STORAGE REST API DEVELOPER REFERENCE

Building Java Servlets with Oracle JDeveloper

You can do THAT with SAS Software? Using the socket access method to unite SAS with the Internet

If your organization is not already

Guide to Analyzing Feedback from Web Trends

2. Accessing Databases via the Web

CIS 551 / TCOM 401 Computer and Network Security. Spring 2007 Lecture 20

Transcription:

Chapter 27 Hypertext Transfer Protocol Columbus, OH 43210 Jain@CIS.Ohio-State.Edu http://www.cis.ohio-state.edu/~jain/ 27-1

Overview Hypertext language and protocol HTTP messages Browser architecture CGI and Java 27-2

Browser Terminology Hypertext: Documents contains pointers to other documents Media = Text, Graphics, Images, voice, animation, video Hypermedia: Documents contain pointers to other media Browser = User program 27-3

Uniform Resource Locator URL = Uniform resource locator = protocol://site/directory/file or mailto:email_address Protocol = http, ftp, gopher, telnet, nntp, smtp, wais ftp://netlab.ohiostate.edu/pub/jain/courses/cis678/f27_htt.html http://www.cis.ohio-state.edu/~jain/cis678.htm mailto:jain@cis.ohio-state.edu Hypertext transfer protocol (HTTP) Hypertext markup language (HTML) HTTP Daemon (httpd) 27-4

HyperText Markup Language (HTML) Header, Body, Anchors, Hyper References Sample Code: <HTML> <HEAD> <TITLE>Hello</TITLE> </HEAD> <BODY> <A HREF="http://www.cis.ohiostate.edu/~jain/greetings.html">How are you</a> </BODY> </HTML> 27-5

Output Hello How are you? 27-6

A Sample List of HTML Tags <A> </A> Anchor (link or name) <BODY> </BODY> Contents <BR> Break <FORM> </FORM> Input form <H1> </H1> Heading level 1 <HEAD> </HEAD> Header of a document <HR> Horizontal Rule <HTML> </HTML> The doc type is HTML <LI> List Item <OL> </OL> Ordered List <P> Paragraph break <PRE> </PRE> Preformatted text <TITLE> </TITLE> Document title <UL> Unnumbered list 27-7

Sample HTTP Exchange telnet www.cis.ohio-state.edu http Connected to tholian.cis.ohio-state.edu. Escape character is '^]'. GET /~jain/temp.html HTTP/1.0 Accept: text/plain, text/html HTTP/1.0 200 OK Server: Netscape-Enterprise/2.0a Date: Tue, 25 Feb 1997 05:04:11 GMT Accept-ranges: bytes Last-modified: Tue, 25 Feb 1997 05:03:07 GMT Content-length: 84 Content-type: text/html 27-8

<HTML> <HEAD> <TITLE>Hello</TITLE> </HEAD> <BODY> Hello! How are you? </BODY> </HTML> Connection closed by foreign host. 27-9

GET Return the contents HEAD Return the header HTTP Requests POST Treat the document as a script and send some data to it PUT Replace the contents with some data DELETE Delete the indicated document 27-10

Header From User-Agent Accept File Accept-encoding Accept-Language Referrer If-Modified-Since Content-length HTTP Request Headers Description Email address of user Client s/w File types that client will accept Compression methods Languages URL of the last document the client displayed Return document only if modified since specified Length (in bytes) of data to follow 27-11

HTTP Status Codes Code Text 2xx Success 3xx Redirection 301 Moved 302 Found 4xx Client Errors 400 Bad Request 401 Unauthorized 404 Not found 5xx Server Errors 500 Internal Error 502 Service overloaded 27-12

HTTP Response Headers Header Description Server Server software Date Current Date Last-Modified Modification date of document Expires Date at which document expires Location The location of the document in redirection responses Pragma A hint, e.g., no cache MIME-version Link URL of document s parent Content-Length Length in bytes Allowed Requests that user can issue, e.g., GET 27-13

HTTP 1.1 Features Persistent TCP Connections: Remain open for multiple requests Partial Document Transfers: Clients can specify start and stop positions Conditional Fetch: Several additional conditions Better content negotiation More flexible authentication 27-14

Browser Architecture Input from mouse and keyboard Controller HTML Interpreter... Optional Interpreter Driver Output sent to display HTTP Client... Optional Client Network Interface 27-15

Key Decisions Presentation separate from content Presentation controlled by the browser Content provided by the server Short term interaction Open connection, exchange, close connection 27-16

Common Gateway Interface (CGI) Dynamic documents: Content changes with time, e.g., counter Initial solution: Server-side includes Special commands to servers Later, a general interface developed at National Center for Supercomputing Applications (NCSA) CGI programs output hypertext and commands to the server Can be in any language, e.g., C, C++, or even be a shell script 27-17

Content/type: text/plain Location: /new/bar.txt <blank line> CGI Example send http://site/new/bar.txt 27-18

CGI Parameters http://www.cis.ohio-state.edu/cgibin/register.sh?fname=raj&lname=jain A question mark separates prefix and suffix (parameters) The parameters are passed to the CGI program using environment variables 27-19

CGI Environmental Variables Variable Server_name Meaning Domain name of the server computer Version of CGI s/w Path in URL after server name Gateway_Interface Script_name Query_string Information following? Remote_addr Browser s address 27-20

Passed in parameters State Information http://www.cis.ohio-state.edu/cgi-bin/counter.sh?$n Example: #!/bin/sh echo content/type: text/plain echo N=$QUERY_STRING echo "<HTML>" echo You have clicked this $N times echo "<A HREF=\"http://cis.ohio-state.edu/cgi-bin/counter.sh?$N\"> echo "Click Here to refresh the page.</a></html>" You have clicked this 4 times Click Here to refresh the page. 27-21

Active = Program Active Documents The output of the program is displayed continuously Useful for animation, Continuous update (clock) Need a program that can run on any computer Java = Just Another Vague Acronym? Not really, the name invented after at a coffee shop. Invented by James Gosling at Sun Microsystems Java programs consist of byte codes that can be interpreted on any computer/operating system. Java provides programming language, runtime environment, class library 27-22

Active Documents (Cont) Active document in source form Compiler Active document in binary form Browser Request for document Server Active document in executable form Document in browser s memory 27-23

Characteristics of Java High Level Hides hardware details General Purpose Object Oriented. Similar to C++ Dynamic Object instances are created at run time Strongly typed Each data item has a type. Operations can be applied only to particular data types. Statically Type Checked Checked at compile time. Not at run-time. Concurrent Allows multiple threads of control 27-24

The Java Run-Time Environment Interpretive execution Automatic garbage collection Includes a socket library for internet access Graphics support 27-25

Summary HTML and HTTP Servers use environment variables to pass parameters to CGI programs CGI programs can be written in any language Static, Dynamic, and Active documents Java provides applets that can be interpreted at any computer Dynamics is server's (CGI) or client's (Java) responsibility 27-26

Read Chapters 27, 28, 29 Homework Submit Answers to Exercises 27.6, 28.3, 29.2 27-27

HTTP: RFCs [RFC1866] T. Berners-Lee, D. Connolly, "Hypertext Markup Language - 2.0", 11/03/1995, 77 pages. [RFC1945] T. Berners-Lee, R. Fielding, H. Nielsen, "Hypertext Transfer Protocol -- HTTP/1.0", 05/17/1996, 60 pages. [RFC2068] R. Fielding, J. Gettys, J. Mogul, H. Frystyk, T. Berners-Lee,, "Hypertext Transfer Protocol -- HTTP/1.1", 01/03/1997, 162 pages. [RFC2069] J. Franks, P. Hallam-Baker, J. Hostetler, P. A. Luotonen, E. L. Stewart, "An Extension to HTTP: Digest Access Authentication", 01/03/1997, 18 pages. [RFC2070] F. Yergeau, G. Nicol, G. Adams, M. Duerst, "Internationalization of the Hypertext Markup Language", 01/06/1997, 43 pages. [RFC2109] D. Kristol, L. Montulli, "HTTP State Management Mechanism", 02/18/1997, 21 pages. 27-28