Web Application Basics
Different Actors in Web application
There are different actors which comes into picture of web application.
End User
Web Client(Browser Application)
Server(Web Server / Application Server)
Actual Page requested on Server
User :
It’s the end user who actually raise the request for a page on Server or submit a
form.
Web Client :
Browsers(IE, Firefox..) are software that knows how to communicate with servers
using HTTP protocol and render the page recieved from server in the form of HTML.
Server :
Servers are kind of software which handle the user request and search for the content
requested by end User and return the appropriate result(Requested Page or Error
Code).
Server can be of two type web server and App Server.
It’s web server which directly handles the user request and pass it to app server to
process.
What is HTML
HTML(Hyper text markup Language) is a language used by servers to send the
response to Browser’s so that they(Browsers) can render the page properly on user
side.
What is HTTP Protocol
HTTP(Hyper Text Transfer Protocol) is protocol used by client(Browser) and
server(Web Server) to communicate. HTTP has web specific featured that runs on
TCP/IP protocol. Structure of HTTP conversation can be divided in two types, HTTP
Request or HTTP Response.
Note*: HTML can be the part of HTTP protocol response.
HTTP Request
When ever end User clicks any link or submit any form browser send HTTP Request to
Server so that server can process it and provide the HTTP Response.
HTTP Request’s are of different kind. HTTP has several methods which inform the
server about the kind of Request is being made by browser.
Methods in HTTP Protocol
GET
POST
PUT
DELETE
HEAD
TRACE
OPTION
CONNECT
GET and POST are the method which is used mostly in web environment and we will
discuss only those.
GET method is the default method which will be used by Browser(If not specified
explicitly). GET method is used by browser to ask(Not submitting any data) for some
kind of resources on server(HTML, Image, PDF etc..).
POST method is used by browser to send some information to server for processing.
Eg. Form Submission..
HTTP Response
This is what server send to user client(Browser) when user ask for something from
Server(GET / POST Request). HTTP Response contains Header and a Body part.
HTTP Response Header Contains below information along with others
Protocol Version(Used by web server)
HTTP Status Code(Successful/Fail/Not Found….)
Content Type (MIME Type)
Content Length
Date
Server details
Content Type(content-type) in header part of HTTP response is also known as MIME
type. This information is used to tell the browser the kind of data server is sending,
weather it is Image or Text or PDF or anything else. According to this information
Browser will know how to handle the data.
HTTP Response, Body part contains the HTML or other content that needs to be
rendered by Browser on client side.
Difference between GET and POST method
GET method used for asking some data from server.
POST is used for submission some data to server.
GET is idempotent while
POST is not idempotent.
GET do not have any BODY part while POST has.
GET can submit some data but that will be the part of Header and there is limitation on
data submitted via GET method while
Post can submit data in body part and there is no restriction on data that can be
submitted in POST request.
Cheat sheet
HTTP protocol is used in the web and it runs over TCP/IP protocol.
Browser makes a HTTP request when it require anything from server and server
will send HTTP Response back to browser.
MIME-Type in HTTP Response tell browser the kind of data server is sending
and browser uses this is data to figure out how to handle it.
HTTP Request have different type of method like GET, PUT, DELETE, OPTION,
TRACE. In web application mainly GET and POST method is used.
GET method is used to ask for data from server while POST method is used to
submit data to server.
GET method can also send data to server but in that case data will be appended
to the end of URL.
POST method appends data in the body of the request.
URL stands for Uniform Resource Locator; Every resource on the web has
unique URL.