Skip to content

.http syntax

Courier reads and writes the JetBrains HTTP Client format, and the httpyac syntax where JetBrains defines nothing. You can edit everything through the app, so you only need this page when you write files by hand.

### Request name
# @name requestName
METHOD url
Header-Name: value
body

A file can hold several requests, each starting with ###.

Request line Type
GET, POST, PUT, PATCH, DELETE, … url HTTP
GRAPHQL url GraphQL
WEBSOCKET ws(s)://… WebSocket
SSE url Server-Sent Events
GRPC host:port/package.Service/Method gRPC
Directive What it does
# @name login Names the request for chaining
# @ref login Runs login first when needed
# @forceRef login Runs login first every time
# @disabled Header: value Keeps a header without sending it
# @auth <kind> key=value … Auth that Courier signs. # @auth none opts out of folder auth
# @assert <target> <op> [value] A check
# @operationName Name The GraphQL operation to run
# @snippet name text A saved WebSocket message
# @proto ./file.proto The .proto for a gRPC request
# @import-path ./dir A folder for the .proto file’s imports
Syntax Meaning
< ./file Send a file’s bytes, or a file part in a multipart body
=== Separates messages in WebSocket and gRPC streams
=== wait-for-server Waits for a server message before sending the next one
Syntax Meaning
< {% … %} before the request line A pre-request script
> {% … %} after the body A response handler
< ./setup.js, > ./check.js Run a script file instead

See Scripts.

Syntax Meaning
{{name}} An environment, folder, runtime or data variable
{{$uuid}}, {{$timestamp}}, {{$isoTimestamp}}, {{$randomInt}} Dynamic variables
{{login.response.body.$.token}} A value from another request’s response