Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

api
node.js
communitycreator

Postman for complete beginners

Abel Lifaefi Mbula

Do you build APIs? Then this shot is for you! Postman is a tool that can help you locally test your APIs.

In this shot, I will not teach you how to build API endpoints as I am assuming that you know how and may even have some already.

What we will be covering:

  • What is Postman?
  • Download and install
  • Test APIs
  • Wrap up

What is Postman?

Before going into depth, lets make sure we have the same understanding.

Imagine you’re building a restful API with NodeJS/Express. Let’s call it wayfarer-app and say it’s a public transportation app. So, you want to send out a list of available trips to the user.

You may have this route localhost:5000/api/v1/trips, but how do you test it? Well, without a testing tool like Postman, you can use the curl program, which is a CLI tool available on Linuxif it’s not available, you can install it.

In curl you would just use this command, curl localhost:5000/api/v1/trips.

However, this will not help you if you are building a complex app. This is where a graphical client may help.

Postman is an API platform for building and using APIs.

Download and install

Now, you are ready to get Postman. You have two possibilities:

  • desktop app
  • browser plugin

You can choose what you want for the basic features, but the desktop app comes with many more features than the plugin. In this shot, we will be using the desktop version. Visit the site to download it. Postman is available in all main desktop OS.

After a while, you’ll have the executable with you. Proceed with the installation as you usually do on your OS. It’s just an app.

Note: For your information, if you’re using a GNU/Linux like Debian, Postman is a portable app, so you just need to double-click the unzipped app to run it. No installation required.

Test APIs

GET request

  • Open Postman
  • Select the right method (GET) on the left corner of the screenshot attached below
  • Put it on the right route
  • Hit the Send button
Testing GET endpoint
Testing GET endpoint

POST request

Change the method to POST the put the right route, then hit the sen button (see image above).

Test any method

I think you now understand how to test the GET and POST method. If so, you can do the same for anyone you want to, be it PATCH, DELETE, etc.

Wrap up

That is it for today. I hope you have appreciated this shot. I have explained to you how to use a tool to test your API endpoints. Don’t forget to share the post around.

RELATED TAGS

api
node.js
communitycreator
RELATED COURSES

View all Courses

Keep Exploring