Postman Tutorial Part 3 – Sending First GET Request in Postman

Hello Folks,

As part of our API Testing series, we will see “Sending first GET request in Postman”.

First of all we need some APIs to test. There are many public APIs available which you can use for testing purpose. I will suggest you to register at below site to use free APIs for testing:

GoRest API for Testing

I will keep sharing links of public APIs for testing.

Above website provides you APIs for basic operations i.e. CRUD which we have already learnt in previous posts.

To perform a GET request below steps are performed:

  1. Select the “GET” in http methods drop down.
  2. Pass the request URI in address bar of Postman.
  3. Add authorization if applicable.
  4. Add headers if applicable.
  5. Click on Send button.

See the image below:

Explanation:

We will pick a GET api from GoRest which list all users:

  • GET /public-api/users/: list all users.

Above we see ‘GET‘ which says GET HTTP operation can be performed on resource “/public-api/users/“. To make a proper URI we need to suffix base URL which is “https://gorest.co.in/” with resource name as  “https://gorest.co.in/public-api/users/“.

GET request does not required any body i.e. payload i.e Request body. You can notice ‘body’ tab is disabled in postman for GET request in above image.

To hit POST request, you need to pass authorisation. You need to pass access token for GoREST APIs. You need to sign up and go to profile to get access token as shown below:

Go to “Authorization” tab and select “OAuth 2.0” in “Type” drop down. Paste copied access token in “Access Token” text box.

Now click on Send button. You will see response body in JSON down. You can see details of all users listed in response body. Details of one user is below:

Also postman returns you the status code and response time. Response time is the time span in which request was hit to endpoint and return response.

More about API Testing in upcoming posts. Stay tuned.

If you have any doubt, feel free to comment below.
If you like my posts, please like, comment, share and subscribe.
#ThanksForReading
#HappyApiTesting

Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning

4 thoughts on “Postman Tutorial Part 3 – Sending First GET Request in Postman

  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

  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

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.
%d bloggers like this: