HTTP 1 Hypertext Transfer Protocol Date: 29-04-2015 By: Raghavendra Joshi
1
HTTP
Hypertext Transfer Protocol
Date: 29-04-2015 By: Raghavendra Joshi
OSI (Open System Interconnection) Model
HTTP: © Qwinix. 20152
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
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.
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
HTTP Request Message Syntax
HTTP: © Qwinix. 20156
Request-LineHeaders...
Content...blank line
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
HTTP Response Message Syntax
HTTP: © Qwinix. 20158
Status-LineHeaders...
Content...
blank line
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>
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
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
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
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.
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)
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
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
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.
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.
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
Proxy Server
HTTP: © Qwinix. 201520
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
US Costa Rica India UAE