HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol.

Slides:



Advertisements
Similar presentations
HTTP HyperText Transfer Protocol. HTTP Uses TCP as its underlying transport protocol Uses port 80 Stateless protocol (i.e. HTTP Server maintains no information.
Advertisements

HyperText Transfer Protocol (HTTP)
HTTP – HyperText Transfer Protocol
Web basics HTTP – – URI/L/Ns – HTML –
1 HTTP – HyperText Transfer Protocol Part 1. 2 Common Protocols In order for two remote machines to “ understand ” each other they should –‘‘ speak the.
16-Jun-15 HTTP Hypertext Transfer Protocol. 2 HTTP messages HTTP is the language that web clients and web servers use to talk to each other HTTP is largely.
HyperText Transfer Protocol (HTTP) Computer Networks Computer Networks Spring 2012 Spring 2012.
HTTP Hypertext Transfer Protocol. HTTP messages HTTP is the language that web clients and web servers use to talk to each other –HTTP is largely “under.
HTTP Headers. Read these slides yourselves This set of slides explains the header fields which are pre-defined in HTTP/1.1 Read these slides yourselves.
How the web works: HTTP and CGI explained
Chapter 2 Application Layer Computer Networking: A Top Down Approach Featuring the Internet, 3 rd edition. Jim Kurose, Keith Ross Addison-Wesley, July.
Web, HTTP and Web Caching
Hypertext Transfer Protocol Information Systems 337 Prof. Harry Plantinga.
HTTP HyperText Transfer Protocol Part 3.
HTTP Overview Vijayan Sugumaran School of Business Administration Oakland University.
2/9/2004 Web and HTTP February 9, /9/2004 Assignments Due – Reading and Warmup Work on Message of the Day.
Hypertext Transport Protocol CS Dick Steflik.
 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.
PL-IV- Group A HTTP Request & Response Header
Rensselaer Polytechnic Institute CSC-432 – Operating Systems David Goldschmidt, Ph.D.
COMP3016 Web Technologies Introduction and Discussion What is the Web?
Java Technology and Applications
HTTP Protocol Specification
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.
Mail (smtp), VoIP (sip, rtp)
HyperText Transfer Protocol (HTTP).  HTTP is the protocol that supports communication between web browsers and web servers.  A “Web Server” is a HTTP.
CSC 2720 Building Web Applications Getting and Setting HTTP Headers (With PHP Examples)
1 Lecture #7-8 HTTP – HyperText Transfer Protocol HAIT Summer 2005 Shimrit Tzur-David.
1 HTTP Messages Herng-Yow Chen. 2 Outline The Flow of Messages The Parts of a Message The various methods that request message support The various status.
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.
2: Application Layer1 CS 4244: Internet Software Development Dr. Eli Tilevich.
Application Layer 2 Figures from Kurose and Ross
Rensselaer Polytechnic Institute Shivkumar Kalvanaraman, Biplab Sikdar 1 The Web: the http protocol http: hypertext transfer protocol Web’s application.
Week 11: Application Layer1 Web and HTTP First some jargon r Web page consists of objects r Object can be HTML file, JPEG image, Java applet, audio file,…
Maryam Elahi University of Calgary – CPSC 441.  HTTP stands for Hypertext Transfer Protocol.  Used to deliver virtually all files and other data (collectively.
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
2: Application Layer1 Web and HTTP First some jargon Web page consists of base HTML-file which includes several referenced objects Object can be HTML file,
Sistem Jaringan dan Komunikasi Data #9. DNS The Internet Directory Service  the Domain Name Service (DNS) provides mapping between host name & IP address.
The HyperText Transfer Protocol. History HTTP has been in use since 1990 (HTTP/0.9) HTTP/1.0 was defined in RFC 1945 (May 1996) and included metainformation.
1 Introductory material. This module illustrates the interactions of the protocols of the TCP/IP protocol suite with the help of an example. The example.
1 HTTP EECS 325/425, Fall 2005 September Chapter 2: Application layer r 2.1 Principles of network applications m app architectures m app requirements.
Web Server Design Week 8 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 3/3/10.
HTTP1 Hypertext Transfer Protocol (HTTP) After this lecture, you should be able to:  Know how Web Browsers and Web Servers communicate via HTTP Protocol.
Web Server Design Week 4 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/03/10.
CIS679: Lecture 13 r Review of Last Lecture r More on HTTP.
Appendix E: Overview of HTTP ©SoftMoore ConsultingSlide 1.
Operating Systems Lesson 12. HTTP vs HTML HTML: hypertext markup language ◦ Definitions of tags that are added to Web documents to control their appearance.
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)
Web Server Design Week 7 Old Dominion University Department of Computer Science CS 495/595 Spring 2010 Martin Klein 2/24/10.
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):
Application Layer 2-1 Chapter 2 Application Layer Computer Networking: A Top Down Approach 6 th edition Jim Kurose, Keith Ross Addison-Wesley March 2012.
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.
Web Protocols: HTTP COMP6017 Topics on Web Services Dr Nicholas Gibbins –
© Janice Regan, CMPT 128, Jan 2007 CMPT 371 Data Communications and Networking HTTP 0.
HTTP Protocol Amanda Burrows. HTTP Protocol The HTTP protocol is used to send HTML documents through the Internet. The HTTP protocol sends the HTML documents.
What’s Really Happening
Hypertext Transfer Protocol (HTTP) COMP6218 Web Architecture Dr Nicholas Gibbins –
Block 5: An application layer protocol: HTTP
HTTP – An overview.
Hypertext Transfer Protocol
COMP2322 Lab 2 HTTP Steven Lee Feb. 8, 2017.
Hypertext Transfer Protocol
Hypertext Transfer Protocol
Hypertext Transfer Protocol
HTTP Hypertext Transfer Protocol
CSCI-351 Data communication and Networks
Presentation transcript:

HTTP Here, we examine the hypertext transfer protocol (http) – originally introduced around 1990 but not standardized until 1997 (version 1.0) – protocol permits transfer of hypertext documents the request is usually generated by clicking on a hyperlink in a browser – server responds to the request and sends back requested document PC running Explorer Server running Apache Web server Mac running Navigator HTTP request HTTP response Different types of machines can request the same resource Apache, is just one of many web servers

Some Definitions Client – the machine requesting a resource – often through a web browser Server – the machine that responds to requests and transfers documents to fulfill the requests – usually a dedicated machine running some server software Request – message that contains an HTTP method (we will cover these shortly) sent from client to server Response –document/file requested, along with a message – or the message alone if the document/file does not exist or the request was ill-formed or not understood Header – both request and response are placed into headers – headers are usually not visible to the user – header requests start with the method (e.g., GET), the resource requested and the protocol/version – we explore headers in more detail in a few slides

HTTP Methods The method is the action that the client wishes the server to perform – GET – request a resource, to be displayed in the web browser (if possible, else save to disk) – Conditional GET includes If-Modified-Since – comes with a specified date, server returns the requested item if it has been modified since that date If-Unmodified-Since If-Match – comes with a condition tested by the server that if true causes the server to return the resource If-None-Match If-Range – return the resource if it falls within a given range – For example: GET /index.html HTTP/1.1 If-Modified-Since: Mon, 11 Jan :30:15 GMT – GET is the most common method – Conditional GETs are used to prevent the server from taking time or Internet usage when it may not be necessary/desired

Other Methods HEAD – return the header portion only, not the actual page PUT – used to upload a page (or content) – must be sent with the content to be uploaded – can only be used if either the user has been authenticated or the server does not require authentication (this would be a security flaw if PUT is allowed without authentication) POST – same as PUT except that POST appends to a file – this can be used to place data into a bulletin/posting board or database OPTIONS – queries the web server to find out what methods are available for use DELETE – used to delete the specified resource TRACE – used for troubleshooting (trace the route) CONNECT – used in conjunction with a proxy server

Headers The header is a portion of the message transmitted – if a request, the header is the request – if a response, it precedes the resource being returned Request headers will include – the method, resource location, protocol and version – host name – user agent (browser) if sent by browser, including version of browser and preferred language (e.g., English) – what form(s) of encoding is preferred – how long the request should remain active Response headers will include – protocol and version, status of request (see next slide) – date/time – server name – last modification date/time – content-type

More on Headers Four classes of headers – general headers consist of four parts Connection indicates whether the TCP connection should close at the end of the request or response or be persistent (the default) Date (date/time of when the message was sent) Transfer-encoding (what if any type of encoding has been applied) Warning – status code – request headers are sent when a browser makes a request of a server and may contain the following Accept – what types of media are acceptable by the client, provided in MIME format, e.g., text/html, image/png, etc Accept-Charset – what character sets are acceptable Accept-Encoding – what types of encoding *can* be applied Accept-Language – what language(s) is(are) preferred From and Host specifiers Conditions – if-match, if-modified-since, if-range, if-unmodified-since, range User-Agent – the type of browser

Continued Response headers – sent by the server to the requester (which may be a proxy server, a web browser, another program (e.g., web crawler) or a command via nc or curl for instance) and may contain – Accept-Ranges (if the request had a range header) – ETags – an identifier generated from the file’s inode – Server – information about the server (web server software and version, platform) Entity headers – may be sent in response to a document being sent via post, put, etc – Allow – lists set of methods available for the server – Content-Encoding, Content-Language, Content-Length, Content-Range, Content-Type – information about the document being sent – Last-Modified – if the item being sent already existed, last modification information about it

Examples GET / HTTP/1.1 Host: User-agent: Mozilla/ Accept */* Accept-Language: en Accept-Encoding: gzip,deflate,compress,identity Keep-Alive: 300 Connection: keep-alive HTTP/ OK Date: Tue, 07 Aug :06:18 GMT Server: Apache Cache-Control: max-age= Expires: Tue, 14 Aug :06:18 GMT Last-Modified: Tue, 06 Feb :16:28 GMT Etag: 1033e-607-3a7fd5d0 Acept-Ranges: bytes Content-Length: 2357 Keep-Alive: timeout=15, max=100 Connection: keep-alve Content-Type: text/html [data] Example GET header Example response from a GET request

Status Codes See Appendix A for the complete list – 100 codes – informational 100 – continue, 101 – switching protocols – 200 codes – success 200 – request succeeded, 201 – resource created, 202 – command accepted, 204 – request succeeded but no content sent back, 205 – reset content – 300 codes – redirection (URL redirected to a different resource) 300 – multiple choices, 301 – resource permanently moved, 302 – resource temporarily moved, 305 – use proxy – 400 codes – client error codes 400 – bad request, 401 – unauthorized, 402- payment required, 403 – forbidden, 404 – not found, 405 – method not allowed, 406 – not accepted, 408 – timeout, 410 – gone – 500 codes – server error codes 500 – internal server error, 501 – not implemented, 503 – service unavailable, 504 – gateway timeout

URLs The URL is the specification of the resource – [protocol:]//host[:port][path/file][?query] protocol is typically http but could be https or ftp or other port defaults to 80 but can be overridden, for instance if the client knows that a different port should be used to fulfill the given request path specifies where to look in the web server’s document space, servers may have defaults if the file is omitted (e.g., index.html, index.php, index.cgi) query is used to specify a given location within a file (e.g., a database record) URI is a more genetic form of identifier used in the semantic web (the book will use URL & URI interchangeably) – URLs consist only of letters, digits, $, -, _,., +, !, *, ’, () – URLs may be case sensitive (true for Linux/Unix servers, not necessarily true for Windows servers)

Negotiation In some cases, a request does not precisely match a resource in which case negotiation may take place – Language negotiation – if a file exists in multiple languages and the client has specified a preference, the server will respond with the document that fits the most preferred language if possible Accept-Language: de, en-us;q=0.7,en;q=0.3 – request German first, and if not available, then American English and finally non-American English – Content negotiation – preference of types by placing types in prioritized list of MIME types Accept: image/png,image/jpg;q=0.8,image/gif;q=0.5 – Content coding – lists what type(s) of encoding can be used to help reduce the message traffic over the Internet These may include gzip (or x-gzip), compress (or x-compress), deflate and identity (no encoding)

Other Topics Caching – to reduce Internet traffic, caching can take place in three different locations – web browser (client) caching – server caching – proxy caching we cover proxy caching in chapter 11 Cookies – HTTP is a stateless form of communication – you cannot store what is currently going on in the communication – a cookie is a file that stores the state (e.g., passwords, preferred pages, contents of shopping carts) – since cookie information is meant to be transmitted to a server, they can represent security holes – what if a cookie is set up by server1 but server2 asks for that information? Cookies can also violate privacy