You learned about AJAX in earlier lessons. When working with web applications, you will need to use HTTP methods to perform a desired action on the server's resources. For example, to get some required data from the server to the frontend you will be using a HTTP method.
Let’s try to understand HTTP methods.
What are the HTTP methods?
As mentioned earlier, there are several HTTP methods that we can use when developing a web application. GET, POST, PUT, HEAD, and DELETE are some of the most regularly used HTTP methods. These methods relate to the operations create, read, update, and delete (or CRUD) resources on the server.
Let’s consider them.
Figure 1 shows how the HTTP requests are sent through the network from Browser to the Server. For an event (e.g., a button click) that has occurred on the client side (browser) will be sent as HTTP request to the server. The backend server process the HTTP request and reply the response to the client browser.
Figure 1: XMLHttpRequest in AJAX
(Source: https://www.tutorialrepublic.com/javascript-tutorial/javascript-ajax.php)
Now, lets consider some differences of these methods.