Sitemap

The GET Method

1 min readApr 6, 2023

--

HTTP requests are request-response protocols in the client-server model. One of these protocols is the GET method. GET makes interactions between the frontend application and the backend server possible.

Note: GET requests should never be used when dealing with sensitive data.

The GET method retrieves data from the server and pulls the data into your computer. GET is used to request data from a specific source. The built in fetch API is used for retrieving resources and interaction with the backend server and accepts one argument: the API endpoint/URL. This is the data source that is being used to grab data.

Note: GET requests are only used to request data.

Get Josh Fowler’s stories in your inbox

Join Medium for free to get updates from this writer.

In an analogy a GET request can be imagined as a restaurant order to the waiter or to the API. The API is retrieving data from the server similar to how a waiter retrieves a restaurant order from the kitchen.

The below is an example of a GET request.

fetch(URL)

.then((response) => response.json())

.then((json) => console.log(json))

In the above the URL would be the restaurant order with the response being the meal. The response is transferred to JSON to process the information.

--

--