Postman Tutorial Part 3 – Sending First GET Request in Postman
As a part of Postman Tutorial – End to End, in this post, we will learn “How to send GET request in the Postman tool.“
- You should have a preferably native Postman app installed on your system.
- Restful-booker API
- GoRest API
I will use below GET APIs for this post to show demo:-
- Get Booking – Get booking details by booking id
- Get Users – Get all users
- Launch the Postman tool app.
- Open “Create a new request” template.
- Select the “GET” in HTTP methods dropdown.
- Pass the request URI in the address bar of Postman.
- Add authorization if applicable.
- Add headers if applicable.
- Click on “Send” button.
- View the response body and other details.
Launch the installed Postman tool. If you have not installed the Postman tool then you can install it from here. Please note here that I have created an account on Postman. If you have not created then you will be seeing some slightly different screen from below:-
There are many ways to open a request template in Postman. You can use any option shown below:-
A request template will be shown as below:-
In the above example, APIs support a GET operation so we need to select “GET” in HTTP verb dropdown in Postman as shown below. Anyway, the default selected option is GET which you can see in the above image.
Every API will have an address i.e URI. A URI is formed as a Base URL plus resource locator. For example:-
In real-time, you may get only resource identifiers. In that case, you need to form a complete URL. Pass this URL in the address bar of in a request template in Postman as shown below.
Since in this example, API does not require any authorization so we will skip this step as of now.
Since in this example, API does not require any headers so we will skip this step as of now.
Click on “Send” button and it will change to “Sending“. It means you need to wait until the response of API is received.
The Postman tool shows the response received in a Response section with status code, time taken to get a response, and size of the response. Those are highlighted below.
Let’s follow the same steps for GetBooking API of Restful-Booker APIs.
There are so many things to observe in GET request as well but since we have just started learning we will cover all concepts.
You can subscribe to my YouTube channel RetargetCommon to learn from video tutorials.
If you have any doubt, feel free to comment below.If you like my posts, please like, comment, share and subscribe.#ThanksForReading
#HappyLearning