Skip to content

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 ​

  1. Open the Headers tab of the request.

  2. Select Add header.

  3. Type the name in Header and the value in Value.

    HeaderValue
    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.

HeaderValueWhat 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.

HeaderAdded whenValue
Content-TypeThe request has a bodyDepends on the body type
AuthorizationThe Auth tab has a type that uses itBuilt from your auth settings
CookieThe cookie jar holds cookies for the addressThe matching cookies

Content-Type ​

Body typeContent-Type
JSON, GraphQLapplication/json
Texttext/plain
XMLapplication/xml
Form URL-encodedapplication/x-www-form-urlencoded
Form datamultipart/form-data with a boundary
Binary fileapplication/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.

  1. Select Bulk edit above the rows.

  2. Paste or type the headers.

    text
    Accept: application/json
    Accept-Language: en
    // X-Debug: 1

    A line that starts with // is a header that is switched off.

  3. Select Key-value edit to return to the table.

The full format is described under Bulk edit.

Common headers ​

HeaderExamplePurpose
Acceptapplication/jsonThe format you want back
Content-Typeapplication/jsonThe format of the body you send
AuthorizationBearer eyJhbGci…Who you are. Use the Auth tab.
Accept-LanguageenThe 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

Next steps ​