Headers
Headers carry extra information with a request: the format you accept, the format you send, who you are. This page shows how to add your own and explains the ones ApiWorkbench adds for you.
New to headers? HTTP basics explains them.
Add a header
Open the Headers tab of the request.
Select Add header.
Type the name in Header and the value in Value.
Header Value Acceptapplication/json
The tab label counts the headers that will be sent: Headers (1).
Switch a header off or remove it
- Untick the box at the start of a row to keep the header without sending it.
- Select the × at the end of a row to remove it.
Use variables in headers
Names and values can contain {{variables}}. They are filled in when you send.
| Header | Value | What is sent |
|---|---|---|
X-Tenant | {{tenant}} | The value of the tenant variable |
X-Request-Id | {{$guid}} | A new random ID on every send |
X-Sent-At | {{$isoTimestamp}} | The current time |
See Variables and environments and Dynamic variables.
Headers added for you
You do not need to type every header. ApiWorkbench adds these when you send.
| Header | Added when | Value |
|---|---|---|
Content-Type | The request has a body | Depends on the body type |
Authorization | The Auth tab has a type that uses it | Built from your auth settings |
Cookie | The cookie jar holds cookies for the address | The matching cookies |
Content-Type
| Body type | Content-Type |
|---|---|
| JSON, GraphQL | application/json |
| Text | text/plain |
| XML | application/xml |
| Form URL-encoded | application/x-www-form-urlencoded |
| Form data | multipart/form-data with a boundary |
| Binary file | application/octet-stream |
To send a different value, add your own Content-Type row on the Headers tab. Yours is used instead. For example, send a JSON body as application/vnd.api+json, or a binary file as image/png.
Form data is the exception: its Content-Type is always written by the app, because the boundary in it has to match the body.
Authorization
Bearer Token, Basic Auth and most other auth types send their result in the Authorization header. Auth is applied last. If you also typed an Authorization row on the Headers tab, the value from the Auth tab replaces it.
To write the header entirely by hand, set Auth type to No Auth and add the row yourself.
See what was really sent
The Headers tab shows what you typed. To see the final headers, with variables filled in and the added ones included, open the Console from the rail and look at the entry for the request. See Console.
Edit many headers at once
Bulk edit turns the table into text with one Header: Value per line. This is the quickest way to paste headers copied from documentation or browser developer tools.
Select Bulk edit above the rows.
Paste or type the headers.
textAccept: application/json Accept-Language: en // X-Debug: 1A line that starts with
//is a header that is switched off.Select Key-value edit to return to the table.
The full format is described under Bulk edit.
Common headers
| Header | Example | Purpose |
|---|---|---|
Accept | application/json | The format you want back |
Content-Type | application/json | The format of the body you send |
Authorization | Bearer eyJhbGci… | Who you are. Use the Auth tab. |
Accept-Language | en | The language you prefer |
If-None-Match | "33a64df5" | Only send the body if it changed |
X-Request-Id | {{$guid}} | An ID to find this request in server logs |