HTTP requests
An HTTP request has a method, a URL, headers and an optional body. The request editor has a tab for each part: Params, Headers, Body, Auth, Scripts and Assert.
Create a request
Section titled “Create a request”- Press ⌘N, or use New request in the sidebar.
- Paste a cURL command into the URL bar, or press ⌘I to open the import dialog’s Paste tab.
- Press ⌘L to jump to the URL bar.
Send with ⌘↵. Cancel a running request with Esc or ⌘.. Save with ⌘S. Courier asks before closing a tab with unsaved changes.
Headers
Section titled “Headers”Add headers in the Headers tab. To keep a header in the file without sending it, untick it. Courier saves it as a # @disabled line:
# @disabled X-Debug-Trace: 1Authorization: Basic user:password is Base64-encoded for you when it’s sent. For other auth types, see Auth.
Write the body in the Body tab. Pick its type, None, JSON, Form, XML or Text, and Courier sets the matching Content-Type header. For multipart, set Content-Type: multipart/form-data yourself.
Send a file
Section titled “Send a file”A body line that starts with < sends a file. Use Choose file… in the Body tab to add it, or write it yourself:
POST {{baseUrl}}/uploadContent-Type: image/png
< ./photo.pngIn a multipart/form-data body, a part whose content is < ./file sends that file, with a content type guessed from its extension.
- Paths are relative to the
.httpfile and may use{{variables}}. - The editor shows each file’s size, in red if the file is missing.
- Files larger than Settings → Requests → Largest file upload (50 MB by default) aren’t sent.
Variables
Section titled “Variables”Type {{ in any field to pick a variable, or press ⌃Space to reopen the list. Hover a variable to see its value.
Courier also has dynamic variables, filled in each time you send:
| Variable | Value |
|---|---|
{{$uuid}} |
A random UUID |
{{$timestamp}} |
The current Unix time in seconds |
{{$isoTimestamp}} |
The current time as an ISO 8601 string |
{{$randomInt}} |
A random integer from 0 to 999 |
See Environments for your own variables.
Protocol and network options
Section titled “Protocol and network options”Courier speaks HTTP/1.1 and HTTP/2, and decodes gzip, deflate and brotli responses. Timeouts, redirects, TLS verification, the User-Agent and HTTP/2 are set in Settings → Requests. Proxies and certificates are on their own page.