I regularly switch between multiple IDEs, mostly VS Code and Visual Studio but sometimes also Rider or Cursor. One of the Visual Studio features I miss when using VS Code is the support for HTTP files.
What if I told you that there is a way to use HTTP files in VS Code? Enter the REST Client extension for Visual Studio Code, a lightweight, powerful tool that lets you test APIs without ever leaving your editor.
What is the REST client extension?
Similar to the HTTP support in Visual Studio, the REST Client extension allows you to send HTTP requests and view responses directly in VS Code. It's minimal, scriptable, and integrates seamlessly into your existing workflow. It offers the same functionality as in Visual Studio and more:
-
.httpand.restfile extensions support - Syntax highlight (Request and Response)
- Auto completion for method, url, header, custom/system variables, mime types and so on
- Comments (line starts with
#or//) support - Support
jsonandxmlbody indentation, comment shortcut and auto closing brackets - Code snippets for operations like
GETandPOST - Support navigate to symbol definitions(request and file level custom variable) in open
httpfile - CodeLens support to add an actionable link to send request
- Fold/Unfold for request block
Installation
Installing REST Client is straightforward:
- Open VS Code
- Go to the Extensions marketplace (Ctrl+Shift+X / Cmd+Shift+X)
- Search for "REST Client" by Huachao Mao
- Click Install
That's it! You're ready to start making API calls.
Creating your first request
Create a new file with the .http or .rest extension. Let's call it example.http:
As soon as you save the file, you'll notice a "Send Request" button appears above the GET line. Click it, and voilà ! The response appears in a new pane to the right, complete with status code, headers, and body.
Working with multiple requests
Of course you typically want to manage multiple API calls. Separate requests using three hash symbols (###):
Important: Notice the empty line between the headers and the JSON body in the POST request. This blank line is required by the extension.
Adding variables
Define variables at the top of your .http file for values that remain constant throughout:
What’s next?
This is only the tip of the iceberg of what is possible with the REST Client extension. there is a lot more to discover. I would recommend giving the extension a try. It transforms VS Code into a capable API testing tool without sacrificing the simplicity and focus that make it a great editor. By keeping your HTTP requests in .http files alongside your code, you create living documentation that your entire team can use and maintain.
Whether you're building a new API, integrating with external services, or just need to quickly test an endpoint, REST Client keeps you in your flow and makes API testing feel like a natural part of your development process.




