.http files, Endpoint Explorer GA (#29977)
parent
fa637cbd65
commit
32e39bdd20
|
@ -5,7 +5,7 @@ description: Learn how to use .http files in Visual Studio 2022 to test ASPNET C
|
|||
monikerRange: '>= aspnetcore-8.0'
|
||||
ms.topic: how-to
|
||||
ms.author: tdykstra
|
||||
ms.date: 05/11/2023
|
||||
ms.date: 08/01/2023
|
||||
uid: test/http-files
|
||||
---
|
||||
# Use .http files in Visual Studio 2022
|
||||
|
@ -26,7 +26,7 @@ The `.http` file format and editor was inspired by the Visual Studio Code [REST
|
|||
|
||||
## Prerequisites
|
||||
|
||||
* [Visual Studio 2022 version 17.6 Preview 6 or later](https://visualstudio.microsoft.com/vs/preview/) with the **ASP.NET and web development** workload installed.
|
||||
* [Visual Studio 2022 version 17.6 or later](https://visualstudio.microsoft.com/vs/) with the **ASP.NET and web development** workload installed.
|
||||
|
||||
## `.http` file syntax
|
||||
|
||||
|
@ -150,8 +150,6 @@ The Visual Studio 2022 `.http` file editor doesn't have all the features that th
|
|||
* Customize response preview
|
||||
* Per-request settings
|
||||
|
||||
The Visual Studio 2022 `.http` file editor is still in preview, and some of these features might be added in the future.
|
||||
|
||||
## Use the `.http` file editor
|
||||
|
||||
Create an `.http` file by using the **Add New Item** dialog or by renaming the extension of any text file to `.http`. Send a request by selecting the green "run" button to the left of the request. The response appears in a separate pane.
|
||||
|
@ -179,10 +177,6 @@ Create an `.http` file by using the **Add New Item** dialog or by renaming the e
|
|||
|
||||
**Endpoints Explorer** is a tool window in Visual Studio 2022 that provides a UI that integrates with the `.http` file editor for testing HTTP requests.
|
||||
|
||||
### Enable Endpoints Explorer
|
||||
|
||||
**Endpoints Explorer** is still a preview feature. It's available in [Visual Studio 2022 version 17.6 Preview 6 and later](https://visualstudio.microsoft.com/vs/preview/), and you have to enable it. To do that, select **Tools** > **Options** > **Environment** > **Preview Features** > **Web API Endpoints Explorer**.
|
||||
|
||||
### Open Endpoints Explorer
|
||||
|
||||
Select **View** > **Other Windows** > **Endpoints Explorer**.
|
||||
|
@ -193,9 +187,8 @@ Right-click a request in **Endpoints Explorer** and select **Generate Request**.
|
|||
|
||||
:::image type="content" source="~/test/http-files/_static/generate-request.png" alt-text="Endpoints Explorer window showing request context menu with 'Generate Request' menu selection highlighted.":::
|
||||
|
||||
* If an `.http` file is open in the editor, the request is added to that file.
|
||||
* If an `.http` file isn't open and one exists in the project, the file is opened and the request is added to that file.
|
||||
* If no `.http` file exists in the project, one is created with the project name as the file name, and the request is added to that file.
|
||||
* If an `.http` file with the project name as the file name exists, the request is added to that file.
|
||||
* Otherwise, an `.http` file is created with the project name as the file name, and the request is added to that file.
|
||||
|
||||
The preceding screenshot shows endpoints defined by the minimal API project template. The following example shows the request that is generated for the selected endpoint:
|
||||
|
||||
|
|
Loading…
Reference in New Issue