What are the protocols used by Ajax ?
In this article we will go to cover what really Ajax means, Asynchronous, and how it makes requests to the server using XMLHTTPRequest and the protocols used by ajax, basically HTTP and HTTPS.
Features of Ajax:
- AJAX is not a programming or a scripting language. It relies on the interplay of a few different technologies and requires a little knowledge of each.
- AJAX uses different protocols to exchange data between browser and server. AJAX communicates asynchronously with the server using the XMLHttpRequest object.
Protocols: Set of rules defined for communication.
AJAX mainly create request to the server for two protocols:
For this request to make to the server need an instance for that XMLHTTPRequest to have the functionality to send these protocol request asynchronously
HTTP – HTTP means HyperText Transfer Protocol. It is the protocol used by the World Wide Web(www) that defines how messages are formatted and transmitted. HTTP is a stateless protocol. because the server does not require to maintain information or status about every user for the duration of multiple requests and does not need to maintain a continuous connection with the client.
Features of HTTP:-
HTTP is an application layer protocol and typically uses TCP
- Tcp tries a retransmission when packet loss is detected .
- Tcp header is not encrypted so http is not encrypted protocol
- In Http communication between webservers and clients
- HTTP work to get requests and give responses.
HTTP is stateless protocol
- The server opens a connection for every request and closing it after the response has been sent.
- every request in html is completely independent
- In http, programming , local storage , cookies, sessions are used to create enhanced user experiences.
HTTP protocol runs on port number 80.
HTTP Headers Fields
Steps in HTTP requests processing –
1.Client requests a connection with the server
2.The server opens a connection with the client
3.The client makes a request to the server
4.The server processes the request
5.The server sends a response to the client
6.The client closes the connection
HTTPS –HTTPS stands for Hyper Text Transfer Protocol Secure It is just a secure version of HTTP. It uses TLS(Transport security layer)/SSL(secure socket layer) encryption over the HTTP protocol . Before request is sent , SSL encryption takes place at the transport level. So here all the request is same as HTTP. So everything in the request is encrypted. Example : credit card data , social security number etc
Features of HTTPS:
- communication between webservers and clients
- Http requests / responses.
- Data sent is encrypted
- Increase security of data transfer.
- SSL/TSL used
- Install certificate on web host.
- Run on port number 443
Some cases XMLHTTPRequest also supports ftp or ftps protocol.
The types of request that you can make using HTTP/HTTPS/FTP/FTPS:
- GET: It requests for a data.
- HEAD: It requests for data but without the response body.
- POST: It submits data causing a change in state on the server.
- PUT: It replaces the specified data with request data.
- DELETE: It deletes the specified data.
- CONNECT: It establishes a tunnel to the server.
- OPTIONS: It describes the communication options for the target data.
- TRACE: It perform message loop-back test along the path to the target data.
- PATCH: It apply partial changes to data.
Please Login to comment...