Now in this article, we will be seeing how to make HTTP GET requests using postman.
- We follow an HTML protocol when we try to communicate between the client machine and the server machine or you can say two different unique systems.
- The GET request fetches this client binary data which is usually a text file formatted in XML or JSON.
- Without causing trouble the job of the GET request is to fetch client data out of the server with a successful 200 status.
If you don't have any idea what an HTTP request is it is simple communication between the client and the server or as we discussed between two different systems for the client's binary data.
- So coming back to GET it is a safe procedure of fetching client data out of the server safe meaning there will be no update, delete, or addition of data or modification occurrence while this process happens.
- This is just a simple old request we do from the server and the server responds to it.
Enough talk let us dive into the real deal!
- Today we will be testing a demo rest API site https://reqres.in/ site.
- This is the GET request endpoint for the site /api/users?page=2
- During this article, I'm using postman version 9.0.9
- Click on file -> new
- When this dialog box pops up click on the HTTP Request.
- This is the result after that there we can see the GET method is selected and the request URL can be pasted there and checked to see whether it is Doing GET from the reqres site.
- Now as we can see we have requested the server and this is the server response we can see below.
- The response is in the format of JSON here it lists users from that site.
- Our status code is 200 meaning the response endpoint is correct and it has returned the needful result.
- This is how we can do the GET request in postman.
- Top of response there is 3 categories pretty, raw, and preview.
- Pretty describes how the response JSON is shown in order and neat.
- Raw is something how we see the response in a browser.
- Preview describes the preview of the page sent.