Markus's Techzone

VS Code - REST Client - WSL

Usually, I use Postman for doing REST requests.

But from time to time, Postman takes a long time to start or it crashes.

So I had a look into VS Code with REST Client.

It's straight forward to use it. Please find a short [tutorial] (dev.to/techwatching/testing-your-api-with-r..) here.

restclient.png

I'm developing on my laptop and also on a VM. The VM is required to access systems of the client that are running on-premise or in VNet in the cloud.

My local machine connects through VPN to VM. Often, I do need to develop in the VM via RDP. By using UnitTests and Mocks it's possible to do this on my local machine. I just need the repositories.

So, I'm not able to REST Client from my local machine, but I can use cURL.

On my VM (Windows 10), WSL is running.

I connect with ssh from my local machine to the VM.

ssh markusm@10...

restclient-ssh.png

Then I execute

wsl

From VS Code, I Copy Request as cURL:

restclient-copy-curl.png

And paste it into my terminal on my local machine.

Curl on WSL:

restclient-wsl-result.png

#vscode#rest#remote
 
Share this