Sunteți pe pagina 1din 23

“Application” is something that allows users to do things.

It is where the human interacts with the


Application to send or receive something. Examples include Web Browser like chrome, firefox and IE
where users try to search for something and Email applications like gmail and outlook from where users
try to send and receive emails.
*** Browser --- When searching for something on INTERNET you use a program/application called a
"browser".
*** Email or Electronic Mail --- exchanging messages between people using electronic devices
“Web” /WWW(world wide web)--- It is not synonym(different name, but same meaning) for Internet, but
is a SUBSET(part) of INTERNET. Internet is the entire physical structure of interconnected networks all
over the globe. A portion of these connect ‘out’ but not allow connections 'in', like our home computer. A
portion are allowed only connections in and out.
***WWW is a information space(where knowledge and information are created, stored and accessed
[spread]) by using URL (Unifrom Reource Locator) for identification and diffused via the internet
According to Sir Tim Berners-Lee, who invented world wide web
1. Reason for Inventing World Wide Web: “In those days, there was different information on different
computers, but you had to log on to different computers to get at it. Also, sometimes you had to
learn a different program on each computer. Often it was just easier to go and ask people when
they were having coffee…”. Tim thought he saw a way to solve this problem of Information
Management.
2. Web is a Concept and it is built on the below three technologies
a) HTML --- HyperText Markup Language --- for creating content to be shared on web.
 HyperLink : text, icon, or image that --- when you click on --- will jump to a new
document or a new section within the current document
 HyperText: text which contains links to other texts --- clicking on a link in a hypertext
document --- will jump to different content.
*** Hypertext is text with hyperlinks --- www. something .com, it is a HyperLink or simply a link. Now if I
told you to go to the same link but with adding a title or a representation of this link, it will be HyperText
 MarkUp Language: language used for defining, processing and presentation of text
(how a text should be present)
b) URI --- Uniform Resource Identifier. A kind of “address” that is unique and used to identify to
each resource on the web. It is also commonly called a URL.
c) HTTP --- Hypertext Transfer Protocol. Allows for requesting and transmitting resources from
one place to other across the web. They use HTTP to request HTML documents and send HTML
documents over INTERNET.
*** Web is a service that operates over the Internet
*** INTERNET is the highway, the World Wide Web is the vehicle used on the highway
*** WWW is a way of
1. CREATING information which can be shared on INTERNET --- using HTML
2. IDENTIFYING information present on the internet --- using URL
3. ACCESSING information via the Internet. exchanging information between computers using the
HTTP protocol, only one of the languages spoken over the Internet created to request and transmit
data from one place to other.
The World-Wide Web is designed around two key concepts:
1. hypertext documents and
2. network based information retrieval.
Hypertext documents are simple documents in which words or phrases act as links to other documents.
Typically hypertext documents are presented to the user with text that can act as a link highlighted in
some way, and the user is able to access the linked documents by clicking with a mouse on the
highlighted areas.
The World-Wide Web extends the well established concept of hypertext by making it possible for
the destination document to be located on a completely different computer from the source document,
either one located anywhere on the network. This was made possible by exploiting the existing
capabilities of the Internet, a world-wide network of interconnected computers developed over the
preceding 20 years, to establish a rapid connection to any named computer on the network.
To achieve this, the World-Wide Web uses a client-server architecture. A user who wants to access
information runs a World-Wide Web client (sometimes referred to as a browser) on their local computer.
The client fetches documents from remote network nodes by connecting to a server on that node and
requesting the document to be retrieved. A document typically can be requested and fetched in less than
a second, even when it resides on the other side of the world from the requester.
Client and Server:
Client and Server both are computers. Server Computer is special computer which has
more
1. Speed
2. Storage Compared to client computer.
It is diagramatically represented as

A Client Computer requests a service. Server Computer checks whether the request is valid/Invalid and if
the request is valid , it searches and provides the service and then the Client Computer consumes/utilizes
that service.
*** Services: describe what a server on the network offers to parties that want to communicate
For Example, According to the Restaurant Network: The Client and the Server
explained, both client and server are human beings. But their activities differ.
*** Client has Requests and Server provides access to the Resources by validating the Requests.
Web Application: program that is stored on a remote server and delivered over the Internet through a
browser interface. It runs on principle of Client-Server Architecture. Examples include gmail, facebook
and instagram.

What does your web server do?


A web server takes a client request and gives something back to the client.

1. A web browser lets a user request a resource. The web server gets the request, finds the resource,
and returns something to the user.
2. Resource is an HTML page/picture/sound file/PDF document. Doesn’t matter—the client asks for
the thing (resource) and the server sends it back.
3. “404 Not Found” error—the response you get when the server can’t find what it thinks you asked
for.
4. When we say “server”, we mean either the physical machine (hardware) or the web server
application (software).

What does a web client do?

A web client lets the user request something on the server, and shows the user the result of the request.
1. Clients --- both (or either) the human user and the browser application doing what the user asked
it to do.
2. Browser --- software (like Chrome or Mozilla) that knows how to communicate with the server.
3. Browser --- interpreting(translate) the HTML code and rendering the web page for the user.

Clients and servers know HTML and HTTP

*** The client uses HTTP to request something from the server

HTML (HyperText MarkUp Language)


1. Server answers a request --- sends some type of content to the browser --- so the browser displays
it
2. Server sends browser, a set of instructions written in HTML
3. HTML --- tells browser how to display content to the user (Web Browsers know what to do with
HTML)

HTTP (HyperText Transfer Protocol)


1. Client and Server Communicate --- using HTTP Protocol --- allows simple REQUEST and
RESPONSE conversations
2. Client sends HTTP Request --- Server answers with an HTTP Response

*** Arguments/Parameters are called Inputs

o HTTP is connectionless: It is a connectionless approach in which HTTP client i.e., a browser


initiates the HTTP request and after the request is sent the client disconnects from server and
waits for the response.
o HTTP is stateless: The client and server are aware of each other during a current request only.
Afterwards, both of them forget each other. Due to the stateless nature of protocol, neither the
client nor the server can retain the information about different request across the web pages.
*** stateless means each request is considered as the new request. In other words, server doesn't recognize
the user by default.
HTML is part of the HTTP response
An HTTP response can contain HTML. HTTP adds header information to the top of whatever content is in
the response (in other words, the thing coming back from the server). An HTML browser uses that
header info to help process the HTML page. Think of the HTML content as data pasted inside an HTTP
response.
*** HTTP message header --- It provides overview of the request/response

HTTP Request and Response Messages


Client and Server communicate by sending messages. The client sends a request message to the
server. The server, in turn, returns a response message. An HTTP message consists of a message
header and an optional message body, separated by a blank line, as illustrated below:

***HTTP Request Message


The format of an HTTP request message is as follow:

1. Request Line --- The first line of the header is called the request line, followed by optional request
headers. The request line has the following syntax:
request-method-name request-URI HTTP-version
request-method-name: request methods like GET, POST.The client can use one of these methods to
send a request to the server.
request-URI: specifies the resource requested.
HTTP-version: Two versions are currently in use: HTTP/1.0 and HTTP/1.1 and HTTP/2.0
(published in 2015).
2. The request headers are in the form of name:value pairs. Multiple values, separated by commas,
can be specified.
request-header-name: request-header-value1, request-header-value2, ...
Examples of request headers are:
Host: www.xyz.com
Connection: Keep-Alive
Accept: image/gif, image/jpeg, */*
Accept-Language: us-en, fr, cn

The first thing you’ll find is an HTTP method name. The method name tells the server the kind of request
that’s being made, and how the rest of the message will be formatted. The HTTP protocol has several
methods, but the ones you’ll use most often are GET and POST.
*** GET is a simple request, POST can send user data

GET is the simplest HTTP method, and its main job in life is to ask the server to get a resource and send it
back. That resource might be an HTML page, a JPEG, a PDF, etc. Doesn’t matter. The point of GET is to get
something back from the server.

POST is a more powerful request. It’s like a GET plus plus. With POST, you can request something and at
the same time send form data to the server (later we’ll see what the server might do with that data).

*** Those are the two big ones that everybody uses. But there are a few rarely used methods like HEAD,
TRACE, PUT, DELETE, OPTIONS, and CONNECT. We will discuss those later.

It’s true... you can send a little data with HTTP GET. Reasons you might use POST instead of GET include:
1. The total amount of characters in a GET is really limited (depending on the server). If the user
types, say, a long passage into a “search” input box, the GET might not work.
2. The data you send with the GET is appended to the URL up in the browser bar, so whatever you
send is exposed. Better not put a password or some other sensitive data as part of a GET!

Anatomy (study by detail) of an HTTP GET request


The path to the resource, and any parameters added to the URL are all included on the “request line”.
Anatomy of an HTTP POST request
HTTP POST requests are designed to make complex requests on the server. For instance, if a user has just
completed a long form, the application might want all of the form’s data to be added to a database. The
data to be sent back to the server is known as the “message body” or “payload” (In computing, payload is
the amount of data transmitted) and can be quite large.
***HTTP Response Message
The format of the HTTP response message is as follows:

Anatomy of an HTTP response, and what is a “ MIME type”?

Now that we’ve seen the requests from the browser to the server, let’s look at what the server sends back
in response. An HTTP response has both a header and a body. The header info tells the browser about the
protocol being used, whether the request was successful, and what kind of content is included in the
body. The body contains the contents (for example, HTML) for the browser to display.
1. The first line is called the status line, followed by optional response header(s). The status line has
the following syntax:
HTTP-version status-code reason-phrase
HTTP-version: The HTTP version used in this session. Either HTTP/1.0, HTTP/1.1 and HTTP/2.0.
status-code: a 3-digit number generated by the server to reflect the outcome of the request.
reason-phrase: gives a short explanation to the status code.
*** Common status code and reason phrase are "200 OK", "404 Not Found", "403 Forbidden", "500
Internal Server Error".
Examples of status line are:
HTTP/1.1 200 OK
HTTP/1.0 404 Not Found
HTTP/1.1 403 Forbidden
2. Response Headers: The response headers are in the form name:value pairs:
response-header-name: response-header-value1, response-header-value2, ...
Examples of response headers are:
Content-Type: text/html
Content-Length: 35
Connection: Keep-Alive
Keep-Alive: timeout=15, max=100
3. The response message body contains the resource data requested.
Uniform Resource Locators, that you know and love --- Every resource on the web has its own unique
address, in the URL format.

A URL (Uniform Resource Locator) is used to uniquely identify a resource over the web. URL has the
following syntax:

protocol://hostname:port/path-and-file-name
Hostname: The DNS domain name (e.g., www.nowhere123.com) or IP address (e.g., 192.128.1.2) of the
server.

Port: Your internet web (HTTP) server software runs on port 80. That’s a standard. If you’ve got a Telnet
server, it’s running on port 23. FTP? 21. POP3 mail server? 110. SMTP? 25. The Time server sits at 37.
Think of ports as unique identifiers. A port represents a logical connection to a particular piece of
software running on the server hardware. That’s it. You can’t spin your hardware box around and find a
TCP port. For one thing, you have 65536 of them on a server (0 to 65535). For another, they do not
represent a place to plug in physical devices. They’re just numbers representing a server application.
Without port numbers, the server would have no way of knowing which application a client wanted to
connect to. And since each application might have its own unique protocol, think of the trouble you’d
have without these identifiers. What if your web browser, for example, landed at the POP3 mail server
instead of the HTTP server? The mail server won’t know how to parse an HTTP request! And even if it
did, the POP3 server doesn’t know anything about serving back an HTML page. If you’re writing services
(server programs) to run on a company network, you should check with the sys-admins to find out which
ports are already taken. Your sys-admins might tell you, for example, that you can’t use any port number
below, say, 3000.
Web Server --- A web server is a computer system that processes requests via HTTP, the basic network
protocol used to distribute information on the World Wide Web. The term can refer to the entire system,
or specifically to the software that accepts and supervises the HTTP requests. The Apache HTTP Server,
also known as Apache is free and open-source (it is free and provides the rights to study, change, and
distribute the software to anyone and for any purpose ) cross-platform (Can be installed or used on any
OS --- Unix, Windows, Mac) web server software.
We’ll talk more about Apache and Tomcat later, but for now let’s assume that our simple web site
is using Apache (the extremely popular, open source web server you’re probably already using). What
would the directory structure look like for a web site called www.wickedlysmart.com, hosting two
applications, one giving skiing advice, and the other beer-related advice? Imagine that the Apache
application is running on port 80. The .html pages are each marked with a letter (A, B, C, D).
Mapping URLs to content
Look at the directory structure on the opposite page, then write in a URL that would get you to each of
the four .html pages marked with the A, B, C, and D. We did the first one (A) for you.

Web pages are those with content that cannot be changed without the developer who developed the
webpage, editing its source code, while dynamic Web pages can display different content from the same
source code.
Web servers love serving static web pages --- A static page just sits there in a directory. The server finds it
and hands it back to the client as is. webpage in which all the information and material is presented
before users as it is exactly stored. Every client/user sees the same thing.
*** Static --- meaning fixed
*** Dynamic --- changing.
which each time shows different content and materials to the user whenever visited. It randomly
changes according to time.
But sometimes you need more than just the web server

Two things the web ser ver alone won’t do


1. If you need just-in-time pages (dynamically-created pages that don’t exist before the request) and
2. the ability to write/save data on the server (which means writing to a file or database), you can’t
rely on the web server alone.
Dynamic content
The web server application serves only static pages, but a separate “helper” application that the web
server can communicate with can build non-static, just-in-time pages. A dynamic page could be anything
from a catalog to a weblog or even just a page that randomly chooses pictures to display.

Saving data on the server


When the user submits data in a form, the web server sees the form data and thinks, “So? Like I care?”. To
process that form data, either to save it to a file or database or even just to use it to generate the response
page, you need another app. When the web server sees a request for a helper app, the web server
assumes that parameters are meant for that app. So the web server hands over the parameters, and gives
the app a way to generate a response to the client
*** The term for a web server helper app is “ CGI” --- Common GateWay Interface
CGI technology enables the web server to call an external program and pass HTTP request information to
the external program to process the request. For each request, it starts a new process.

Using CGI, here’s how it might work for a dynamic web page that has the current server date.
There are many problems in CGI technology:
1. If number of clients increases, it takes more time for sending response.
2. For each request, it starts a process and Web server is limited to start processes.
3. It uses platform dependent language e.g. C, C++, perl. (Platform dependent --- can run in different
operating environments)

S-ar putea să vă placă și