Endpoint Explorer in Visual Studio 2022

In VS 2022, there is a new feature that can be useful to test our APIs.

In case we do not have Swagger, we can use Endpoint Explorer from VS and can test and play with API’s endpoints.

Steps

Open any API project and go to View->Other windows->Endpoint Explorer as per the screen below.

API project

After opening Endpoint Explorer, we have the left window from where we can see all the listed API endpoints in applications.

Endpoint Explorer

Let’s Invoke

Right-click on the endpoint and click on Generate Request.

Generate Request

We will have the window below. We can click on the send request button and get a response.

Send request button

We will get a response in the new window as below.

Get response

GET by ID. I have updated the ID as per the request URL and got the corresponding response.

Get

Next Step

We can save this above middle window as a file with a .http extension and can use it next time without going to Endpoint Explorer. We can say this file is a ready-made rest client for playing and testing our endpoint.

Endpoint Explorer

I saved the above file and used the next file for testing purposes.

Thanks


Similar Articles