HTTP editor
The .http
file editor is a friendly way to test mainly API projects created with ASP.NET Core. Some of the features of this editor are as follows:
- It allows the creation and update of
.
http
files - It allows the testing of HTTP requests specified in the
.
http
file - It displays responses to the requests
To better understand the syntax within an .http
file, let’s continue working with the Chapter6_Code_API
project. This time, create a request for the POST /books endpoint, params (Chapter6_Code_API.Book book book), as you can see in Figure 6.29:
Figure 6.29 – POST request added according to the Endpoint selected
In case there is a previously created .http
file, it will be updated to display the new HTTP request, as you can see in Figure 6.29.
Let’s analyze the syntax of the file:
- Line 1: A variable is created, which we can identify by the ‘
@
’ symbol, calledChapter6_Code_API_HostAddress...