DEV Community

Cover image for Triggering your first API request with Postman.
Shihaan W S
Shihaan W S

Posted on

Triggering your first API request with Postman.

A beginner friendly tutorial to get started with Postman.

Hello there 👋
Almost everyone who works into web development, front-end or back-end, has in some part of their development heard of "Postman" or some other API testing service to test their app they are building. But, do we all know how powerful Postman is?
Alt Text

So today I would like you to join me on a short adventure of writing a simple API test with Postman, let's go!

This Tutorial assumes you to have some familiarity with API. So I am not going to explain what an API is, or why you should care, or any of that.

"A Beginner's Guide To APIs" : Check here!

Basically, You can send requests in Postman to connect to APIs you are working with. Your requests can retrieve, add, delete, and update data. Whether you are building or testing your own API, or integrating with a third-party API, you can try out your requests in Postman.

Alt Text

For example, if you're building a client application (e.g. a mobile or web app) for a shop, you might send one request to retrieve the list of available products, another request to create a new order (including the selected product details), and a different request to log a customer in to their account.

When you send a request, Postman will display the response received from the API server in a way that lets you examine, visualize and troubleshoot.

Okay! Let’s start talking to the API, yeah? First let’s download Postman.
https://www.postman.com/downloads/
Postman is free software that lets you test APIs. You can test other people’s public APIs, like we will do today.

We are going to use @kennethreitz's web-exposed API for our first test, httpbin to try out Postman.

Once you’ve downloaded and installed Postman, if it gives you any tutorial popups, just skip them.There’s a bunch of buttons and words we don’t need to care about right now.

First GET Request

  • Type http://httpbin.org/get in the enter URL request field.
  • To try out the endpoint, leave the GET method selected and click Send.

Alt Text

  • You will find the status code 200 OK which means that EndPoint is correct and it has returned the desired results. Alt Text

First POST Request

  • Type http://httpbin.org/post in the enter URL request field.
  • Leave the POST method selected from the dropdown.
  • As soon as you select the POST request type in Postman you will see that the option Body is enabled which has different options to send the data inside the body.

    • Form-data
    • X-www-form-urlencoded
    • Raw
    • Binary Alt Text
  • For post you will need form data to be posted .

  • For now, lets stick on to form-data. Type your required key-value pair and click Send.

Alt Text

  • Again you will find the status code 200 OK, the time taken to process your post request and your new JSON data with added key-value data.
  • So this way you could visualize,test and debug your API endpoints. Wasn't that amazing? Alt Text

That was all for this article. Today you've learned how to send a GET/POST request to a public API and experimenting with your data.
If you want to learn more about Postman and its features refer to the following links:

Enjoy building cool APIs ✨

Top comments (3)

Collapse
 
liyasthomas profile image
Liyas Thomas

Open source online alternative: Hoppscotch.

GitHub logo hoppscotch / hoppscotch

👽 A free, fast and beautiful API request builder used by 120k+ developers. https://hoppscotch.io

Collapse
 
shihaanws profile image
Shihaan W S

Woww. Will check that!

Collapse
 
ritchiepulikottil profile image
Ritchie Pulikottil

That's amazingggggg <3