DEV Community

Cover image for Bye bye Postman ! Let's share your REST API calls in team, easily !
Jonathan BROSSARD for Monisnap

Posted on

Bye bye Postman ! Let's share your REST API calls in team, easily !

As developer, we are using tools to make REST API calls (Postman, Insomnia, PostWoman...), and these tools are very usefull.

The limits

Make calls to test an API is fine, but if you want to edit, version, or simply share it with your team ... it's not very handy.

Indeed, you can use Postman paid plans for instance, but it means that you need to pay, and it means that all your team needs to use Postman, again one more tool...

Do you know REST Client ?

Logo REST Client VS Code Extension

REST Client* is a VS Code extension.

It will let you to send HTTP requests and view responses into VS Code. And only based on a text file, which can easily be versioned among your repository. ๐Ÿ™

Pros

The main advantage is to be able to version and share your API calls.

If you're working on an internal API, you may want to share how to test a new endpoint with your colleagues.

REST Client is a good easy way to do it !

Another good point is simplicity. All you need to do/have, is ONE file. Also, if you jump between projects and do not remember how works an API/Service on which you did not work since a while, just look at this file !

Cons

You have to use VS Code... but for a lot of known reasons among internets, you are using Emacs, VI, or VS Code ๐Ÿ˜„

What's next ?

Here is how to begin.

The file

Only create a file with .http extension, for instance doc.http

And then, VS Code will show you the file as :

doc.http preview into VS Code

And by clicking on "Send Request", a new tab with all request response details will be opened.

doc.http response preview into VS Code

Go further

You may also use environment variables to easily switch between you env and avoid any api-key or token manually update in the file, or url update etc...

Here is how to use environment variables, just like that :

Here, I created 4 environments : local, dev, staging, production.

These 4 environments have their own host and token variables, with their specific values.
But they also share a variable, named partnerUniqueToken (don't ask me why ... too many partners don't have several env...).

Hope it helps !

Big up to Julien who discovered this extension !

Latest comments (113)

Collapse
 
monaye profile image
Monaye Win

Since Postman free plan will archive your collection (community.postman.com/t/how-do-i-g...), this is great way to share the API with the team!! Nice!!

Collapse
 
shivuslr41 profile image
ยง#รฎ\/รป

Great extension!! what about streaming data. Does it support websocket?

Collapse
 
icealgagan profile image
Iceal Gagan

Wow, will try this out

Collapse
 
crisdan1905 profile image
Cristian Danilo Gutiรฉrrez

Great article, I'm only confused about how to set environments. I can't find any guide to set environments (not even in the extension documentation). Can someone help me please???

Collapse
 
monisnapjonathan profile image
Jonathan BROSSARD Monisnap

Hi @crisdan1905 ,

Don't you find more info event under "Environments and custom/system variables support" section in marketplace.visualstudio.com/items... page ?

Jon

Collapse
 
crisdan1905 profile image
Cristian Danilo Gutiรฉrrez • Edited

Hi Jon, it's just that I hadn't worked with environment variables before on VSCode, so I had no idea how to create an environment file and VSCode documentation about it was a bit confusing to me. Finally, I figured it out in another guide. It may be useful to explain how to create the file in your documentation :)

Great tool by the way, I just loved it and will keep using it

Collapse
 
princebillygk profile image
Prince Billy Graham Karmoker

I still love postman. It have some other features too ๐Ÿ˜„

Collapse
 
monisnapjonathan profile image
Jonathan BROSSARD Monisnap

yes but you do not have the ability to have it into your repo without, each time, export it, and 20 times in a day... it's painful

Collapse
 
offero profile image
Chris

Love REST client!

Collapse
 
anoobis profile image
Anubis

Meh, it's just different. Postman is good and it's simply doing its job. I can't see any reason I should migrate.

Collapse
 
davidhopkins profile image
davidhopkins • Edited

Very important to be able to integrate API calls like these into your test pipelines -- so does it work-with/replace Newman?

Collapse
 
hyde_stevenson profile image
[mastodon] Hyde Stevenson

And for those using vim, you can use something like this :

github.com/diepm/vim-rest-console :)

Collapse
 
monisnapjonathan profile image
Jonathan BROSSARD Monisnap

Thanks a lot @hyde_stevenson :)

Collapse
 
hyde_stevenson profile image
[mastodon] Hyde Stevenson

You're welcome :)