Skip to content

Basic Syntax

Every .rext file contains one or more HTTP requests. This page covers the fundamental structure.

A request follows this order:

[directives] → @name, @id, @collection, etc.
METHOD URL → GET https://api.example.com/users
[headers] → Content-Type: application/json
→ (empty line)
[body] → { "key": "value" }
→ (empty line or @directive)
[post-directives] → @assert, @capture

Requests are separated using one of three delimiters:

DelimiterDescription
###Classic separator (can include text as comment)
---Clean Markdown-style separator
Double empty lineTwo consecutive empty lines implicitly separate requests
### Auth Requests
POST https://api.example.com/auth/login
Content-Type: application/json
{
"email": "user@example.com",
"password": "secret"
}
---
GET https://api.example.com/users
GET https://api.example.com/profile

Rext supports all standard HTTP methods:

GET · POST · PUT · PATCH · DELETE · HEAD · OPTIONS

GET https://api.example.com/users
POST https://api.example.com/users
Content-Type: application/json
{
"name": "John",
"email": "john@example.com"
}
DELETE https://api.example.com/users/123

Headers are defined as Key: Value pairs, one per line, immediately after the method line:

POST https://api.example.com/data
Content-Type: application/json
Authorization: Bearer {{token}}
X-Custom-Header: my-value
{
"data": "payload"
}

The body comes after an empty line following the headers. Rext supports any content type:

POST https://api.example.com/users
Content-Type: application/json
{
"name": "John",
"email": "john@example.com"
}
POST https://api.example.com/login
Content-Type: application/x-www-form-urlencoded
username=john&password=secret
POST https://api.example.com/webhook
Content-Type: text/plain
This is a raw text body

Any text after ### on the same line is treated as a comment:

### This is a comment about auth requests
POST https://api.example.com/auth/login