Skip to content

Request Headers

WARNING

This API is frozen and deprecated. Please use the fluent API from 0.9.4 on

There are two ways to supply headers with your http requests:

  • default headers
  • per request headers (overriding defaults)

Default Headers

All requests sent by the Api object include default headers. Some are built-in, and you can add/override these defaults.

Built-in

There are two built-in default headers provided by halchemy:

Content-type': 'application/json'
Authorization': 'Basic cm9vdDpwYXNzd29yZA==

The Authorization header's token is the base-64 encoded string root:password, i.e. the client will attempt to access the resource using username root and the password password using Basic Authentication (RFC7617). If your API does not require authorization, this header will, of course, be ignored.

Add/override default headers

When you create the Api object, you can supply additional headers, and/or override the built-in ones.

Per Request Headers

Each request method accepts a headers object which, if supplied, will add to or override the default headers for this one call only.

Released under the MIT License.

Released under the MIT License.