When a browser communicates with a server, it uses HTTP.
HTTP stands for Hypertext Transfer Protocol.
All AJAX communication is based on HTTP requests and responses.
An HTTP request is sent from the client to the server.
The request contains information such as method, URL, and optional data.
The HTTP method defines the type of action being performed.
The most common methods used in AJAX are GET and POST.
After processing the request, the server sends an HTTP response.
The response contains a status code and returned data.
The browser checks the response status to confirm whether the request was successful.
HTTP request and response form the backbone of all web communication including AJAX, APIs, and backend services.
After completing this lesson, you should clearly understand how data travels between browser and server using HTTP.