Spanish Total.js
English
Documentation For AI agents
Contents

Test APIs with .api files

Write HTTP requests in a file and send them from the editor.

.md GitHub
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 : value defines a variable.
  • $name in 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

  1. Select the lines of one request.
  2. Press Ctrl+B, or Cmd+B on macOS.

The Output panel opens with the status, the headers and the response.

An .api file with a selected request and its response in the Output panel

Click Clear output to empty the panel.

Made in Europe