0% found this document useful (0 votes)
3 views10 pages

HTTP Basics1

HTTP is a foundational application-layer protocol for data communication on the web, utilizing a client-server model for request-response interactions. Clients initiate requests to servers, which process these requests and return responses, with each request being stateless and independent. State management techniques such as cookies, session tokens, and local storage are used to maintain session information across requests.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views10 pages

HTTP Basics1

HTTP is a foundational application-layer protocol for data communication on the web, utilizing a client-server model for request-response interactions. Clients initiate requests to servers, which process these requests and return responses, with each request being stateless and independent. State management techniques such as cookies, session tokens, and local storage are used to maintain session information across requests.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Introduction to

HTTP
HTTP is the foundation of data
communication on the World Wide Web,
defining how messages are formatted and
transmitted between web browsers and web
servers.
Key Characteristics
- Application-layer protocol
- Client-server communication model
- Foundation of data exchange on the
internet
Request-Response
Paradigm
 Client (Web Browser) → Request →
Server
 Client ← Response ← Server
Client Responsibilities
 Initiate communication
 Send well-formed HTTP requests
 Specify desired resource and
action
 Include necessary headers and
Request-Response
Paradigm
Server Responsibilities
- Listen for incoming requests
- Process requests
- Generate appropriate responses
- Return requested resources or error
messages
Request-Response
Paradigm

Client Request: Server Response:


GET /index.html HTTP/1.1 200 OK
HTTP/1.1 Content-Type:
Host: text/html
www.example.com Content-Length:
User-Agent: 1234
Mozilla/5.0
HTTP is a Stateless
Protocol
 Each request is independent
 Server does not retain information
between requests
 Every request must contain all necessary
information
Implications
 Scalability
 Simplified server
design
 Increased
State Management
Techniques

1. Cookies
 Small text files stored on
client-side
 Sent with each request
 Maintain session information
State Management
Techniques

2. Session Tokens
 Unique identifier for user
session
 Typically passed in headers
or URLs
 Server-side session tracking
State Management
Techniques

3. Local Storage
 Client-side storage
mechanism
 Persists between browser
sessions
Structure of HTTP
Messages
HTTP Request Message
METHOD /path-to-resource
HTTP/version-number Header-Name-1:
value
Header-Name-2: value

[ optional request body ]


Example
GET /sj/index.html
HTTP/1.1 Host:
www.mywebsite.com
Structure of HTTP
Messages
HTTP Response Message
HTTP/version-number status-code
message Header-Name-1: value
Header-Name-2: value

[ response body ]
Example
HTTP/1.1 200 OK
Content-Type:
text/html Content-
Length: 9934

You might also like