Triggering your first API request with Postman.
Tags: testing, api, webdev
Published: 2020-11-28 08:58:48

**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](https://dev-to-uploads.s3.amazonaws.com/i/yeea9z58z2cqvsg7u99s.png)

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!](https://dev.to/hpsetti/a-begineer-s-guide-to-apis-4b4d)

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](https://dev-to-uploads.s3.amazonaws.com/i/sigojozgvjxl9zrd1460.jpg)

>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](https://github.com/postmanlabs/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](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](https://dev-to-uploads.s3.amazonaws.com/i/ok1jk5vv04lxu38twrfz.png)

- You will find the status code **200 OK** which means that EndPoint is correct and it has returned the desired results.
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/u4o0o0wewnavgn4ztc26.png)


### First POST Request

- Type [http://httpbin.org/post](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](https://dev-to-uploads.s3.amazonaws.com/i/qvzqme34nm28ufa8s06e.png)
- 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](https://dev-to-uploads.s3.amazonaws.com/i/63rklm2kb3ham5fso8d6.png)

- 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.
</br>
</br>
Wasn't that amazing?
![Alt Text](https://dev-to-uploads.s3.amazonaws.com/i/aabtou1pn0rraqdnwnui.gif)
<br>

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:

    
- [Postman Official YouTube Channel] (https://www.youtube.com/channel/UCocudCGVb3MmhWQ1aoIgUQw)
- [Postman Documentation] (https://learning.postman.com/docs/getting-started/introduction/)


Enjoy building cool APIs ✨