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.
Features
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.
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.
Designed for C# projects using ASP.NET Core (controllers or minimal APIs)
Usage
Open a C# file containing controller actions or minimal API routes.
Look for the Create HTTP Test or Go 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.
Extension Settings
This extension does not currently contribute any user-configurable settings.
Known Issues
Only supports C# files and standard ASP.NET Core patterns (controllers and minimal APIs).
Does not support custom routing attributes or advanced route patterns.