Testing OData services using Visual Studio Code extensions
Using the Swagger user interface to test OData controllers can quickly get clumsy. A better tool is the Visual Studio Code extension named REST Client:
- If you have not already installed REST Client by Huachao Mao (
humao.rest-client
), then install it in Visual Studio Code now.If you have only been using Visual Studio 2022 up to this point, you must install Visual Studio Code now, even if you only use it to run this useful REST Client extension.
- In your preferred code editor, start the
Northwind.OData.Service
project web service and leave it running. - In Visual Studio Code, in the
apps-services-net7
folder, if it does not already exist, create aRestClientTests
folder, and then open the folder. - In the
RestClientTests
folder, create a file namedodata-catalog.http
and modify its contents to contain a request to get all categories, as shown in the following code:GET...