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?
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.
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.
Postman is free software that lets you test APIs. You can test other people’s public APIs, like we will do today.
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.
- Type http://httpbin.org/get in the enter URL request field.
- To try out the endpoint, leave the GET method selected and click Send.
- You will find the status code 200 OK which means that EndPoint is correct and it has returned the desired results.
- 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.
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.
- 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?
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 ✨