Postman Tutorial Part 3 – Sending First GET Request in Postman

Introduction

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

  1. You should have a preferably native Postman app installed on your system.

Sample APIs for Testing

  1. Restful-booker API
  2. GoRest API

I will use below GET APIs for this post to show demo:-

  1. Get Booking – Get booking details by booking id
  2. Get Users – Get all users

Step by step process to hit a GET request in Postman

  1. Launch the Postman tool app.
  2. Open “Create a new request” template.
  3. Select the “GET” in HTTP methods dropdown.
  4. Pass the request URI in the address bar of Postman.
  5. Add authorization if applicable.
  6. Add headers if applicable.
  7. Click on “Send” button.
  8. 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

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

    1. 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.

  1. Hello Amod,

    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

    1. Hi,
      Sure I will update in this post as well. Anyway token will be dependent on user account. FYI.

  2. 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

    {
    “_meta”: {
    “success”: false,
    “code”: 401,
    “message”: “Authentication failed.”
    },
    “result”: {
    “name”: “Unauthorized”,
    “message”: “Your request was made with invalid credentials.”,
    “code”: 0,
    “status”: 401
    }
    }

Leave a Reply

Your email address will not be published. Required fields are marked *