Http basics by-joshi_29_4_15-ppt

21
HTTP 1 Hypertext Transfer Protocol Date: 29-04-2015 By: Raghavendra Joshi

Transcript of Http basics by-joshi_29_4_15-ppt

Page 1: Http basics by-joshi_29_4_15-ppt

1

HTTP

Hypertext Transfer Protocol

Date: 29-04-2015 By: Raghavendra Joshi

Page 2: Http basics by-joshi_29_4_15-ppt

OSI (Open System Interconnection) Model

HTTP: © Qwinix. 20152

Page 3: Http basics by-joshi_29_4_15-ppt

Hyper Text Transfer Protocol

HTTP: © Qwinix. 20153

What is HTTP?

It is the set of rules for bi-directional transfer of

data on the World Wide Web

Data May be – Images – Text - HTML page – JSON -

XML

Page 4: Http basics by-joshi_29_4_15-ppt

HTTP Components

HTTP: © Qwinix. 20154

Client – Web browser, Mobile browser, etc..

Web Server – Apache, IIS(Internet Information Server)

from Microsoft.

Resource – Plain text, HTML, Images, JSON, XML etc

URL - Uniform Resource Locator. Where exactly resource

is located on the internet.

Page 5: Http basics by-joshi_29_4_15-ppt

URL Syntax

HTTP: © Qwinix. 20155

<scheme> : //<host> :<port>

/<path> ;<parameters> ?<query>

#<fragment>Scheme - The protocol you are usingHost - Host name or ip numberPort - TCP port number that protocol server is

usingPath - Path and filename reference of object on

server

Page 6: Http basics by-joshi_29_4_15-ppt

HTTP Request Message Syntax

HTTP: © Qwinix. 20156

Request-LineHeaders...

Content...blank line

Page 7: Http basics by-joshi_29_4_15-ppt

A Request Example

HTTP: © Qwinix. 20157

GET /foo/bar/index.html HTTP/1.1

User - Agent: Mozilla/4.0

Host: www.example.com

Accept - Language: en-us

Date: Wed, 29 Apr 2015 10:15:56 GMT

Server: Apache

Last-Modified: Wed, 29 Apr 2015 09:15:56 GMT

Accept-Ranges: bytes

Content-Length: 51

Page 8: Http basics by-joshi_29_4_15-ppt

HTTP Response Message Syntax

HTTP: © Qwinix. 20158

Status-LineHeaders...

Content...

blank line

Page 9: Http basics by-joshi_29_4_15-ppt

HTTP Response Message Syntax

Copyright © Qwinix. 20149

HTTP/1.1 200 OK

Date: Wed, 29 Apr 2015 10:15:56 GMT

Server: Apache/2.2.14 (Win32)

Last-Modified: Wed, 29 Apr 2015 09:15:56 GMT

Accept-Ranges: bytes

Content-Length: 51

Content-Type: text/html

Connection: Closed

<html>

<body>

<h1>Hello, World!</h1>

</body>

</html>

Page 10: Http basics by-joshi_29_4_15-ppt

HTTP Methods

Copyright © Qwinix. 201410

GET - Used to retrieve existing

resource identified by the URL HEAD - Used to retrieve meta

information about the existing

resource with out response body. It is

the little brother of GET POST - Used to create a new resource

on the server identified by the URL

Page 11: Http basics by-joshi_29_4_15-ppt

HTTP Methods

Copyright © Qwinix. 201411

PUT - Used to update existing

resource identified by the URL DELETE - Used to remove the

existing resource identified by the

URL CONNECT - Establishes a tunnel to a

server identified by URI

Page 12: Http basics by-joshi_29_4_15-ppt

HTTP Response

HTTP: © Qwinix. 201512

Status-codes 1xx - Informational 100 - When the server receives the request

headers, 100 Continue occurs. In this case,

the client is required to proceed in sending

the request body. 101 – Switching Protocol

The client request has asked the server to switch

protocols and the server is acknowledging that it

will do so and comply with the client's request

Page 13: Http basics by-joshi_29_4_15-ppt

HTTP Response

HTTP: © Qwinix. 201513

Status-codes 2xx - Success

The action was successfully received,

understood, and accepted 200 OK 201 POST command successful 202 The request is accepted for processing, but

the processing is not complete. 203 - The information in the entity header is from

a local or third-party copy, not from the original

server. 204 - A status code and a header are given in the

response, but there is no entity-body in the reply.

Page 14: Http basics by-joshi_29_4_15-ppt

HTTP Response

HTTP: © Qwinix. 201514

Status-codes 3xx - Redirection

Further action must be taken in order

to complete request 300 Resource found at multiple

locations 301 Resource moved permanently 302 Resource moved temporarily 304 Resource has not modified (since

date)

Page 15: Http basics by-joshi_29_4_15-ppt

HTTP Response

HTTP: © Qwinix. 201515

Status-codes 4xx - Client error

The request contains bad syntax or

cannot be fulfilled 400 Bad request from client 401 Unauthorized request 402 Payment required for request 403 Resource access forbidden 404 Resource not found 405 Method not allowed for resource 406 Resource type not acceptable

Page 16: Http basics by-joshi_29_4_15-ppt

HTTP Response

HTTP: © Qwinix. 201516

Status-codes 5xx - Server error

The server failed to fulfill an

apparently valid request 500 Internal server error 501 Method not implemented 502 Bad gateway or server overload 503 Service unavailable / gateway

timeout 504 Secondary gateway / server

timeout

Page 17: Http basics by-joshi_29_4_15-ppt

HTTP < 1.0

HTTP: © Qwinix. 201517

Stateless : Server does not

remember any previous requests.

Non Persistent: Separate TCP

connection is needed to serve each

resource.

Page 18: Http basics by-joshi_29_4_15-ppt

HTTP 1.1

HTTP: © Qwinix. 201518

Server can be made to remember

the previous request using cookies

and sessions.

Persistent: Single TCP connection is

needed to serve multiple resources.

Server leaves the connection open

even after serving the request and

closes connection on timeout.

Page 19: Http basics by-joshi_29_4_15-ppt

Proxy Server

HTTP: © Qwinix. 201519

It is the dedicated computer or

software system running on a

computer that acts as intermediary

between client and original server. These are used for two purposes Caching As Firewall

Page 20: Http basics by-joshi_29_4_15-ppt

Proxy Server

HTTP: © Qwinix. 201520

Page 21: Http basics by-joshi_29_4_15-ppt

21

For further details, please contact :

Qwinix Technologies Inc 5350 S. Roslyn Street, Suite # 306

Greenwood Village, CO 80111 Tel: 303-459-4310 Fax: (720) 285-1936

[email protected]

US Costa Rica India UAE