Exploring OData services using HTTP/REST tools
Instead of a browser, a better tool for exploring your OData service is the VS Code extension named REST Client or the HTTP Editor built-in to Visual Studio.
Creating an HTTP file for making requests
Let's explore the many types of query that your OData web service can automatically handle by creating an .http
file:
- In your preferred code editor, start the
Northwind.OData
project web service and leave it running. - In the
HttpRequests
folder, create a file namedodata-catalog.http
and modify its contents to contain some basic requests to the catalog model, as shown in the following code:
### Configure a variable for the web service base address.
@base_address = https://localhost:5101/catalog/
### Make a GET request to the base address.
GET {{base_address}}
### Make a GET request to the base address for metadata.
GET {{base_address}}$metadata
### Make a GET request to get all categories.
GET {{base_address}}categories
### Make a GET...