Test APIs with .api files
Write HTTP requests in a file and send them from the editor.
On this page
A file with the .api extension holds HTTP requests that you can send from the editor.
Write a request
Create a file such as requests.api:
// Requests of my application
$host : https://www.example.com
GET $host/ping/
POST $host/api/items/
Content-Type: application/json
{ "name": "Demo item" }- A line with
$name : valuedefines a variable. $namein a request is replaced by its value.- Lines that start with
//are comments. - Headers go under the first line of the request, and the body comes after them.
Send a request
- Select the lines of one request.
- Press
Ctrl+B, orCmd+Bon macOS.
The Output panel opens with the status, the headers and the response.

Click Clear output to empty the panel.