Bye bye Postman ! Let's share your REST API calls in team, easily !
Tags: vscode, rest, postman
Published: 2020-01-10 10:56:48

---
title: Bye bye Postman ! Let's share your REST API calls in team, easily !
published: true
description: If you find Postman boring or non intuitive, you'll love this post
tags: vscode, rest, postman
cover_image: https://thepracticaldev.s3.amazonaws.com/i/vmcdhatblf6n75ob8zoy.png
---

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](https://thepracticaldev.s3.amazonaws.com/i/452qob0efqpz249wrvnm.png "Logo REST Client VS Code Extension")


<a href="https://marketplace.visualstudio.com/items?itemName=humao.rest-client" target="_blank">REST Client</a>* 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

{% gist https://gist.github.com/monisnap-jonathan/9c0a55938900d4cbf5194039ae978c8e.js %}

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

![doc.http preview into VS Code](https://thepracticaldev.s3.amazonaws.com/i/3ssx618zejysxau11b20.png)

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

![doc.http response preview into VS Code](https://thepracticaldev.s3.amazonaws.com/i/fqamilfzz042c6vgvl5s.png)

### 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 : 

{% gist https://gist.github.com/monisnap-jonathan/08285ebabc490fa6edfe9ce23ed6d7ff.js %}

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](https://dev.to/monisnapjulien) who discovered this extension !