Web Essentials: Client, Server and Communication
Web Essentials: Client, Server and Communication
C L I E N T, S E RV E R A N D
C O M M U N I C AT I O N
Client-Server Model
A file named
course.html
http://vtop.com/course.html
HTTP: Hypertext Transport Protocol
HTTP is a form of communication protocol which specifies how web clients and servers should
communicate.
A client always initiates a request message to the server; the server generates a response message.
HTTP:hyper text transfer protocol
The hypertext transfer protocol (HTTP) was developed by Tim Berners-Lee in 1991
• HTTP was designed to transfer pages between machines
• The client (or Web browser) makes a request for a given page and the Server is responsible for
finding it and returning it to the client
• The browser connects and requests a page from the server
• The server reads the page from the file system, sends it to the client and terminates the
connection
HTTP Request Message
Every HTTP request message has the same basic structure:
◦ Start Line (request method, URI, HTTP version)
◦ Header field(s) (one or more)
◦ Blank line
◦ Message body (optional)
POST: send the request to the server through a request body in the header.
More Differences
HTTP Header Fields
The Host header field is required in every HTTP/1.1 request message.
HTTP/1.1 200 OK
HTTP/1.1 404 NOT FOUND
IP address and Domain Name
Every computer on the Internet has an IP address such as 192.0.34.166
Humans find it easier to refer to computers by names, such as yahoo.com. This is called
host/domain name.
DNS (Domain Name Service) provides a mechanism for mapping back and forth between IP
addresses and host names.
Client-Server Communication
What is the IP address of
“yahoo.com”
Client DNS
yahoo.com’s IP
address is
98.138.252.30
HTTP Request
HTTP Response
Yahoo
Server
Web Client
Web client is a software that accesses a web server by sending an HTTP request
message and processing the resulting HTTP response.
Browser-Wars
◦ En.wikipedia.org/wiki/Browser_wars
◦ Each company trying to add features and performance to its browser in order to
increase its market share.
Server
The primary feature of every web server is to accept HTTP request from web
client and return an appropriate resource (if available) in the HTTP response.