Postman Tutorial Part 3 – Sending First GET Request in Postman – Make Selenium Easy
As a part of Postman Tutorial – End to End, in this post, we will learn “How to send GET request in the Postman tool.“
Prerequisite
- You should have a preferably native Postman app installed on your system.
Sample APIs for Testing
- 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
Step by step process to hit a GET request in Postman
- 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 Postman tool app
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:-
Open Create a new request template
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:-
Select the “GET” in HTTP methods dropdown
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.
Pass the request URI in the address bar of Postman
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.
Add authorization if applicable
Since in this example, API does not require any authorization so we will skip this step as of now.
Add headers if applicable
Since in this example, API does not require any headers so we will skip this step as of now.
Click on “Send” button
Click on “Send” button and it will change to “Sending“. It means you need to wait until the response of API is received.
View the response body and other details
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