Invoking APIs‎ > ‎

HTTP Headers

You can change the behavior of the API engine by specifying one of the following HTTP header as part of your requests.

Authorization

The Authorization HTTP header provides the auth token as part of a request. Almost all REST calls must include an auth token. For example:

Authorization: CALiveAPICreator abcdef123456:1

Note: The :1 suffix at the end of the auth token is required.

Content-Type

The Content-Type HTTP header specifies the format of the payload (for example, JSON and XML). It is applicable for only POST and PUT. For example:

Content-Type: application/json

Accept

The Accept HTTP header is applicable to all requests and indicates the format the caller can handle in the request. For example:

Accept: application/json,application/xml

The default response format is JSON. You can change this response format.

For more information about how to set the expected response format globally across an API, see API Properties.

Forward

The Forward HTTP header indicates that the request is being forwarded on behalf of another caller. This is often used by gateways. For example:

Forward: host="acme.com:1234";proto="https"

This HTTP header changes the base URLs in the response to the specified protocol, host, and port number.

Comments