Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

HTTP Protocol: Understanding Data Transfer between Web Servers and Clients, Slides of Digital Communication Systems

An overview of http (hypertext transfer protocol) version 1.1, a protocol used for transferring data between web servers and clients. It covers the basic operation of http, popular web servers and clients, and the format of http requests and responses. The document also discusses http headers, status codes, and features such as authentication, persistent connections, and content type negotiation.

Typology: Slides

2012/2013

Uploaded on 04/29/2013

awais
awais 🇮🇳

4.3

(15)

155 documents

1 / 17

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
HyperText Transfer Protocol
HTTP v1.1
Docsity.com
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download HTTP Protocol: Understanding Data Transfer between Web Servers and Clients and more Slides Digital Communication Systems in PDF only on Docsity!

HyperText Transfer Protocol

HTTP v1.

What is HTTP?

 Protocol for transfer of data between Web

servers and Web clients (browsers).

 Popular Web servers:

 Apache HTTPD

 JBoss

 Tomcat

 Popular Web clients:

 Firefox

 Opera

 wget

 Defined formally by IETF as RFC2616.

Basic Operation

Client Server

Request Method URL / RelativeURL Request Headers Request Body

Protocol Version Status Code Response Headers Response Body

Example HTTP Communication

 Client→Server:

GET / HTTP/1.

Host: www.cs.uct.ac.za

 Server→Client:

HTTP/1.1 200 OK

Content-type: text/html

Content-length: 1024

Really old webpage!

Amaya

Tim Berners-Lee’s WWW Vision

 The WWW is meant to be a place for accessing

and authoring content, not just the former.

 Amaya is W3C’s experimental 2-way browser

that works with their 2-way server Jigsaw.

 Is access more important than content

creation? Why (not)?

HTTP Response

Status Reason Description 200 OK Successful request 206 Partial Content Successful request for partial content 301 Moved Permanently Resource has been relocated

304 Not Modified Conditional GET but resource has not changed 400 Bad Request Request not understood 403 Forbidden Access to resource not allowed 404 Not Found URI/resource not found on server 500 Internal Server Error Unexpected error

 Format:

 HTTPVersion StatusCode Reason

HTTP Headers

 (^) Accept: Indicates which data formats are acceptable.  (^) Accept: text/html, text/plain  (^) Content-Language: Language of the content  (^) Content-Language: en  (^) Content-Length: Size of message body  (^) Content-Length: 1234  (^) Content-Type: MIME type of content body  (^) Content-Type: text/html  (^) Date: Date of request/response  (^) Date: Tue, 15 Nov 1994 08:12:31 GMT  (^) Expires: When content is no longer valid  (^) Expires: Tue, 15 Nov 1994 08:12:31 GMT  (^) Host: Machine that request is directed to  (^) Host: www.cs.uct.ac.za  (^) Location: Redirection to a different resource  (^) Location: http://myserver.org/  (^) Retry-After: Indicates that client must try again in future  (^) Retry-After: 120

Non-static content

 HTTP can support content that is not static.

 For a GET request, data is appended to the

request – for a POST request, data is contained

in the request body.

 Responses are generated by a piece of

software and are similar to the non-static

version.

Common Gateway Interface

 Common Gateway Interface (CGI) defines how

parameters are passed to Web applications.

 For a GET request, the URL contains

 http://host:port/path/file?var1=value1&var2=value2&var3=value
 These are called URL-encoded parameters.

 The part beyond ‘?’ is passed in the environment of the

Web application as a QUERY_STRING.

 The application interprets the QUERY_STRING,

generates an HTTP response and writes it to stdout,

with at least a Content-type header.

 HTML forms generate GET requests that can easily be

converted to support CGI.

CGI POST

-----------------------------41184676334 Content-Disposition: form-data; name="var1" something ----------------------------- Content-Disposition: form-data; name="var2"; filename="testpost.html“ Content-Type: text/html



-----------------------------41184676334--

recursive example if you fill in the form embedded here, this is the data that gets sent to the server

 GET cannot handle file uploads.

 File uploads are handled as Multipart-MIME

messages sent from the client to the server.

Not-So-Common Gateway Interfaces

 Instead of QUERY_STRING and stdin and stdout

for data,

 Java servlets use methods to acquire

parameters and output data.

 PHP defines global variables for GET/POST

query parameters.