HTTPLens is a Visual Studio Code extension that enhances your C# web API development workflow by providing CodeLens actions to quickly create and navigate to HTTP request test files. It streamlines the process of generating and managing .http
files for your API endpoints, making it easier to test and debug your APIs directly from your editor.
- CodeLens for C# Endpoints: Adds CodeLens actions above your C# controller actions and minimal API routes to:
- Create a corresponding
.http
test file for the endpoint if it doesn't exist. - Quickly navigate to the existing
.http
test file for the endpoint.
- Create a corresponding
- Automatic HTTP Request Generation: Generates a ready-to-use HTTP request template for your endpoint, using the method and route detected from your code.
- Seamless Navigation: Jump directly from your C# code to the relevant HTTP test file for fast testing and iteration.
- Install from the Visual Studio Code Marketplace or by searching for "HTTPLens" in the Extensions view.
- Reload VS Code if required.
- Visual Studio Code v1.99.0 or higher
- Designed for C# projects using ASP.NET Core (controllers or minimal APIs)
- Open a C# file containing controller actions or minimal API routes.
- Look for the
Create HTTP Test
orGo to HTTP Test
CodeLens above your endpoint methods. - Click
Create HTTP Test
to generate a new.http
file with a request template for the endpoint. - Click
Go to HTTP Test
to open the existing test file for that endpoint.
The generated .http
files are placed in a tests/http/
folder in your workspace. The extension tries to detect your application's base URL from launchSettings.json
if available.
This extension does not currently contribute any user-configurable settings.
- Only supports C# files and standard ASP.NET Core patterns (controllers and minimal APIs).
- Does not support custom routing attributes or advanced route patterns.
Please report issues or feature requests on the GitHub Issues page.
Contributions are welcome! Please see the GitHub repository for details on how to contribute, submit issues, or request features.
MIT