HTTP, circa HTTP protocol. GET /foo/bar.html HTTP/1.1. Sviluppo App Web 2015/ Intro 3/3/2016. Marco Tarini, Uninsubria 1

Similar documents
World-Wide Web Protocols CS 571 Fall Kenneth L. Calvert All rights reserved

WEB TECHNOLOGIES CHAPTER 1

Produced by. Mobile Application Development. Higher Diploma in Science in Computer Science. Eamonn de Leastar

Notes beforehand... For more details: See the (online) presentation program.

The HTTP protocol. Fulvio Corno, Dario Bonino. 08/10/09 http 1

COSC 2206 Internet Tools. The HTTP Protocol

2- Application Level Protocols HTTP 1.0/1.1/2

Computer Networks. Wenzhong Li. Nanjing University

CS631 - Advanced Programming in the UNIX Environment

World Wide Web, etc.

Applications & Application-Layer Protocols: The Web & HTTP

C22: Browser & Web Server Communication

Introduction to HTTP. Jonathan Sillito

World Wide Web. Before WWW

CSCI-1680 WWW Rodrigo Fonseca

CSCI-1680 WWW Rodrigo Fonseca

CSE 333 Lecture HTTP

HTTP Protocol and Server-Side Basics

CS193i Handout #18. HTTP Part 5

The World Wide Web. Internet

How to work with HTTP requests and responses

CSE 333 Lecture HTTP

Introduc)on to Computer Networks

Outline of Lecture 3 Protocols

Internet Architecture. Web Programming - 2 (Ref: Chapter 2) IP Software. IP Addressing. TCP/IP Basics. Client Server Basics. URL and MIME Types HTTP

HTTP Security. CSC 482/582: Computer Security Slide #1

The HTTP Protocol HTTP

Application Layer: The Web and HTTP Sec 2.2 Prof Lina Battestilli Fall 2017

Web History. Systemprogrammering 2006 Föreläsning 9 Web Services. Internet Hosts. Web History (cont) 1945: 1989: Topics 1990:

CS 43: Computer Networks. Layering & HTTP September 7, 2018

Giving credit where credit is due

HTTP Reading: Section and COS 461: Computer Networks Spring 2013

Lecture 7b: HTTP. Feb. 24, Internet and Intranet Protocols and Applications

WWW: the http protocol

WWW Document Technologies

Applications & Application-Layer Protocols: The Web & HTTP

Application Protocols and HTTP

HTTP and HTML. We will use HTML as a frontend to our webapplications, therefore a basic knowledge of HTML is required, especially in forms.

Introduction to Ethical Hacking

Recitation 13: Proxylab Network and Web

ECE697AA Lecture 2. Today s lecture

Web, HTTP and Web Caching

RESTful Services. Distributed Enabling Platform

INTERNET ENGINEERING. HTTP Protocol. Sadegh Aliakbary

Getting Some REST with webmachine. Kevin A. Smith

World Wide Web. World Wide Web - how it works. WWW usage requires a combination of standards and protocols DHCP TCP/IP DNS HTTP HTML MIME

COMPUTER NETWORKS AND COMMUNICATION PROTOCOLS. Web Access: HTTP Mehmet KORKMAZ

1.1 A Brief Intro to the Internet

About the Tutorial. Audience. Prerequisites. Copyright & Disclaimer

DATA COMMUNICATOIN NETWORKING

Introduction to Internet, Web, and TCP/IP Protocols SEEM

Information Network Systems The application layer. Stephan Sigg

Jeff Offutt SWE 642 Software Engineering for the World Wide Web

HTTP Review. Carey Williamson Department of Computer Science University of Calgary

LAMP, WEB ARCHITECTURE, AND HTTP

CS144 Notes: Web Standards

HTTP TRAFFIC CONSISTS OF REQUESTS AND RESPONSES. All HTTP traffic can be

Unraveling the Mysteries of J2EE Web Application Communications

Global Servers. The new masters

Application Level Protocols

EDA095 HTTP. Pierre Nugues. March 30, Lund University

Assignment, part 2. Statement and concepts INFO-0010

Proxying. Why and How. Alon Altman. Haifa Linux Club. Proxying p.1/24

HTTP: Advanced Assessment Techniques

Network Applications and the Web

Electronic Mail. Three Components: SMTP SMTP. SMTP mail server. 1. User Agents. 2. Mail Servers. 3. SMTP protocol

Lecture 3. HTTP v1.0 application layer protocol. into details. HTTP 1.0: RFC 1945, T. Berners-Lee HTTP 1.1: RFC 2068, 2616

CMSC 332 Computer Networking Web and FTP

Lecture 7 Application Layer. Antonio Cianfrani DIET Department Networking Group netlab.uniroma1.it

Hypertext Transport Protocol

CMPE 151: Network Administration. Servers

COMPUTER NETWORK. Homework #1. Due Date: March 29, 2017 in class

SIP Session Initiation Protocol

Web Information System Design No.5 Accessing Web Documents. Tatsuya Hagino

REST Easy with Infrared360

Chapter 2: outline. 2.6 P2P applications 2.7 socket programming with UDP and TCP

Distributed Systems. Examples Characteristics

HTTP Server Application

Web Search An Application of Information Retrieval Theory

Distributed Systems. Examples Characteristics. Werner Nutt

SCS3004 Networking Technologies Application Layer Protocols

Layered Model. DoD Model. ISO/OSI Model

powered by Series of Tubes Senator Ted Stevens talking about the Net Neutrality Bill Jul 17, powered by

INFOH-511 WEB SERVICES. LECTURE 1: Introduction

EE 122: HyperText Transfer Protocol (HTTP)

Networking. INFO/CSE 100, Spring 2006 Fluency in Information Technology.

Networking. Layered Model. DoD Model. Application Layer. ISO/OSI Model

How A Website Works. - Shobha

CORS Attacks. Author: Milad Khoshdel Blog: P a g e. CORS Attacks

1.1 A Brief Intro to the Internet

CSSE280: Introduction to Web Programming

CS 43: Computer Networks. HTTP September 10, 2018

HTTP Request Handling

Networking and Internet

Computer Networks - A Simple HTTP proxy -

2. Introduction to Internet Applications

02267: Software Development of Web Services

REST Web Services Objektumorientált szoftvertervezés Object-oriented software design

Web Technology. COMP476 Networked Computer Systems. Hypertext and Hypermedia. Document Representation. Client-Server Paradigm.

Announcements. The World Wide Web. Retrieving From the Server. Goals of Today s Lecture. The World Wide Web. POP3 Protocol

Transcription:

HTTP protocol HTTP, circa 1989 a resource «give me the HTML representation of thatresource» «ok, here» Client request GET /hello.txt Server response Hello, world! Client Server Http 1.1 Request line Client request Server response GET /hello.txt HTTP/1.1 Start line HTTP/1.1 200 OK GET /foo/bar.html HTTP/1.1 Host: www.example.com Headers body Content-type: text/plain <empty line> Hello, world! the method the resource the format protocol Marco Tarini, Uninsubria 1

GET /books/list.html HTTP/1.1 Host: localhost:3001 User-Agent: Mozilla/5.0 (Intel Mac OS X; en-us; rv:1.8.0.7) Gecko Accept: text/xml,application/xml,text/html;q=0.9,*/* Accept-Language: en-us,en Accept-Encoding: gzip,deflate Accept-Charset: ISO-8859-1,utf-8 $ GET /index.html HTTP/1.1 HTTP/1.1 301 Moved Permanently Date: Mon, 06 Dec 2010 17:19:49 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14. Location: http://localhost/manual/ Content-Length: 232 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>moved Permanently</h1> <p>the document has moved <a href="http://localhost/manual/">here</a>.</p> </body></html> REQUEST LINE (by client) $ GET /index.html HTTP/1.1 HTTP/1.1 301 Moved Permanently Date: Mon, 06 Dec 2010 17:19:49 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14. Location: http://localhost/manual/ HEADER Content-Length: 232 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> BODY </head><body> <h1>moved Permanently</h1> (the resource) <p>the document has moved <a href="http://localhost/manual/">here</a>.</p> </body></html> $ GET /index.html HTTP/1.1 HTTP/1.1 301 Moved Permanently Date: Mon, 06 Dec 2010 17:19:49 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14. Location: http://localhost/manual/ Content-Length: 232 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>moved Permanently</h1> <p>the document has moved <a href="http://localhost/manual/">here</a>.</p> </body></html> Marco Tarini, Uninsubria 2

Status codes Redirections 2xx 3xx 4xx 5xx success redirection client error server error 301 Moved Permanently 302 Found 303 See Other Examples 200 OK 301 Moved Permanently 410 Unauthorized 404 Not Found 500 Internal Server Error REQUEST LINE (by client) $ GET /index.html HTTP/1.1 HTTP/1.1 301 Moved Permanently Date: Mon, 06 Dec 2010 17:19:49 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14. Location: http://localhost/manual/ HEADER Content-Length: 232 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> BODY <title>301 Moved Permanently</title> </head><body> A common example: <h1>moved Permanently</h1> <p>the document a HTML has moved document <a href="http://localhost/manual/">here</a>.</p> </body></html> Marco Tarini, Uninsubria 3

HTML documents A web page is a HTML document Consists of text (what you see) markup (what it looks like) references to other resources (e.g. images of videos) links to other pages hyper-links functionality e.g. scripts World Wide Web the Web, WWW A collection of documents in HTML and other resources images, multimedia, videos located by URL interlinked (for the most part) the World Wide Web A Web-Site: a collection of related web-pages World Wide Web: a collection of Web-Sites billions of them! and counting (fast!) plus, the deep web What is a resource? A resource can be anything that has identity. Familiar examples include an electronic document, an image, a service (e.g., today's weather report for Los Angeles ), and a collection of other resources. Most familiar example of a resource: a file sitting on a web server (an image, an hypertext, a movie, a text ). Marco Tarini, Uninsubria 4

HTTP protocol Examples of resources «give me the HTML representation of thatresource» a resource Version 22.1 of a (desktop) application http://example.com/software/releases/22.1.tgz The most recent version of a (desktop) application. http://example.com/software/releases/latest.tgz Client «ok, here» Server The articles of 2 October 2007 of a blog http://example.com/blog/2007/10/2 An article about RESTful Web Services http://example.com/blog/restful-web-services URI URI examples Uniform Resource Identifiers (URI) provide a simpleand extensiblemeans for identifyinga resource. ftp://ftp.is.co.za/rfc/rfc1808.txt gopher://spinaltap.micro.umn.edu/00/weather/california/los%20angeles http://www.math.uio.no/faq/compression-faq/part1.html mailto:mduerst@ifi.unizh.ch news:comp.infosystems.www.servers.unix telnet://melvyl.ucop.edu Marco Tarini, Uninsubria 5

URI vs URL URI examples URI: Uniform Resource Identifier URL: Uniform Resource Locator URL refers to the subset of URI that identify resources via a their network location <scheme>:<scheme-specific-part> mailto:marco.tarini@uninsubria.it http://www.example.com/pages/hello.txt telnet://192.0.2.16:80/ news:rec.arts.int-fiction http URL http URL http://<host><path> http://www.example.com/ scheme: http host: www.example.com path: / http://<host><path> http://www.example.com/books/list.html scheme: http host: www.example.com path:/books/list.html Marco Tarini, Uninsubria 6

http uri http URL http://<host><path>[<query>] http://www.google.com/search?q=facoceri&start=10 scheme: http host: www.google.com path: /search query string: q=facoceri&start=10 http://<host><path>[<query>][<fragment>] http://www.google.com/search?q=facoceri&start=10#fragm scheme: http host: www.google.com path: /search query string: q=facoceri&start=10 fragment: fragm Http methods Safe methods GET Get a resource from the server. POST Send data to the server for processing. HEAD Get just the headers PUT Upload resource DELETE Remove a document OPTIONS Ask what methods are available. A method is safewhen it has no visible effect on the status of the app Marco Tarini, Uninsubria 7

GET vs. POST GET vs POST GET safe POST not safe Get: useful to readinfo Post: useful to modify info bookmarkable parameters in URL not bookmarkable parameters in BODY Web Applications A web application is basically a refurbished Web Page / Web Site with functionalities Distributed Application Architecture Client Server Database Back End But, behind the scenes Marco Tarini, Uninsubria 8

Web Application Architecture Back End Web Application Architecture Back End (any) Browser internet Server LAN Database HTTP LAN Client Web Server / Application Server Client Web Server / Application Server DataBase Apps Desktop Applications Web Applications Mobile Applications Mobile Web Applications Risoluzione di un URL http://www.uninsubria.it/home.html 1.Ask to the DNS the IP address of www.uninsubria.it 2. Connect with TCP to port 80 of 193.206.179.151 3. Send GET /home.html HTTP/1.1 4. Receive the document home.html 5.Display it on screen Marco Tarini, Uninsubria 9

Stateless http://www.google.com/search?q=facoceri&start=15 Esempionon-stateless: ftp $ ftp ftp.funet.fi Connected to ftp.funet.fi. 331-Welcome to the FUNET anonymous ftp archive Password: Using binary mode to transfer files. ftp> cd pub 250 OK. Current directory is /pub ftp> get README local: README remote: README 226-File successfully transferred ftp> quit 221-Goodbye. You uploaded 0 and downloaded 18 kbytes. 221 Logout. $ Addressability A Web Application is addressable if it exposes its relevant data as resources Marco Tarini, Uninsubria 10

Google Mail è indirizzabile? https://mail.google.com/mail/#inbox/11dbe2460af15fe6 https://mail.google.com/mail/#label/aaa-agire https://mail.google.com/mail/#search/marco $ GET /index.html HTTP/1.1 HTTP/1.1 301 Moved Permanently Date: Mon, 06 Dec 2010 17:19:49 GMT Server: Apache/2.2.14 (Unix) mod_ssl/2.2.14. Location: http://localhost/manual/ Content-Length: 232 Content-Type: text/html; charset=iso-8859-1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>301 Moved Permanently</title> </head><body> <h1>moved Permanently</h1> <p>the document has moved <a href="http://localhost/manual/">here</a>.</p> </body></html> MIME types text/plain text/html image/gif image/jpeg <primary type>/<subtype> application/pdf Mime types text/html; charset=utf-8 <primary type>/<subtype>; <parameters> Marco Tarini, Uninsubria 11