HTTP headers

The APIs expect a request header in standard HTTP 1.1 format and return a standard HTTPS response header.

The servers return an HTTP status code. If a request fails, Sabre® APIs also return a type and message in JSON format. For more information, see Status codes and errors.

Your client application must be able to handle the following in responses from the HTTPS servers. This is not a complete list of required header fields.

  • Transfer-Encoding: chunked. Sabre HTTPS servers divide response data into small chunks and send the chunks sequentially. The total length may be unknown.
  •   100 Continue.

The following topics describe the basic HTTP header fields in Our REST API requests and responses.

HTTP request headers

HTTP headers for successful responses

HTTP request headers

The following table describes the HTTP headers in authentication and authenticated requests. For examples, see Sample authentication request and response formats and Sample authenticated request and response formats for an API call.

HTTP Request Header Fields

Required/Optional

Value

Description

Content-Type

Required in requests to authenticate

application/x-www-form-urlencoded

This field is required with the value shown for authentication requests on the authentication endpoint.

Do not include this field in authenticated API calls.

Authorization: Basic

Required to authenticate using encoded client credentials as a string using OAuth 2.0

Your base64 encoded Client ID and password string

This field must be included for authentication requests on the authentication endpoint.

Do not include this field in authenticated API calls.

Authorization: Bearer

Required for authenticated API calls using OAuth 2.0

Your authentication token

This field must be included for authenticated requests.

Obtain the token from the access_token field in the payload of the authentication response.

Do not include this field in requests for authentication.

Accept

Optional

If present, the value shown is required.

application/json

JSON is supported.

The server uses external libraries to handle HTTP traffic, consequently, a variety of formats may be returned, such as JSON, HTML, or no payload.

Accept-Encoding

Optional


If present, the value shown is required.

gzip

Specifies the compression technique

Accept-Encoding: gzip requests a compressed response.

This release supports gzip.

If the field contains values in addition to gzip,deflate, the Sabre HTTP servers ignore them.

HTTP headers for successful responses

The Sabre HTTP servers do not fully control the HTTP header fields. Some of the header fields are controlled by libraries that are compliant with the HTTP specification. Sabre HTTP servers are fully-compliant with the HTTP 1.1 specification, therefore, the server may return more headers. For more information, see the HTTP specification  .

The following table includes headers that are returned in successful responses. Failed responses also return some of these headers plus additional fields. For examples of successful responses, see Sample authentication request and response formats and Sample authenticated request and response formats for an API call. For examples of errors, see Status codes and errors.

Response HTTP Header Fields

Description

Vary

Conditional

If the request header has Accept or Accept-Encoding fields, the return of a corresponding variable is required.

The value in this response field varies, and is dependent on specific Accept-* headers and their values in the corresponding request.

Example: When a client requests a response in a compressed format, pass gzip in an HTTP header with the response.

Content-Type

Describes the type of representation

Value: application/json

JSON is supported.

The server can return gzip,deflate.

Content-Length

If the response has a fixed length, this header is used. It specifies the size in bytes of the body of representation.

If the response is chunked, this header is omitted.

Transfer-Encoding

Describes the transformation type used to transfer the message body from the sender to the recipient

If the response is chunked, the value is chunked.

Date

Date-timestamp

Returned in all authenticated responses

Cache-Control

Returned in a successful authentication response

Pragma

Returned in a successful authentication response

Docs Navigation