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.
Sample APIs for Testing
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.
Find all Selenium related posts here, all API manual and automation related posts here, and find frequently asked Java Programs here.
Many other topics you can navigate through the menu.
7 thoughts on “Postman Tutorial Part 3 – Sending First GET Request in Postman”
Looks like things are changed..
1) Body tab is enabled for get request now in postman
2) Also api are working directly without any Authorisation tried this https://gorest.co.in/public-api/users/
Any HTTP request message is allowed to contain a message body, and thus must parse messages with that in mind. Server semantics for GET, however, are restricted such that a body, if any, has no semantic meaning to the request. The requirements on parsing are separate from the requirements on method semantics.
So, yes, you can send a body with GET, and no, it is never useful to do so.
Reference – https://stackoverflow.com/questions/978061/http-get-with-request-body#:~:text=Server%20semantics%20for%20GET%2C%20however,never%20useful%20to%20do%20so.
Earlier Postman tool used to disable Body tab for GET request which is changed now.
Yes for the example APIs used in this post do not require authorization. Updated post. Thanks.
Thanks for the details posts and explanations. I’m following your posts one by one and here i got struck . Finally i got the solution as Gaurav has mentioned above.
If possible please update the this small piece in this post. Hope will do that..
Bearer Token: aZXWUrexFYxdrd53HET_pf4vtegRLoRusW5v
Sure I will update in this post as well. Anyway token will be dependent on user account. FYI.
I had to login to the site and generate the token. THat token needs to be put under Authorization with Type as ‘Bearer Token’. If we are not doing that we are getting the error as
“message”: “Authentication failed.”
“message”: “Your request was made with invalid credentials.”,
I noticed that. Will update post accordingly.