Community articleSpecifying request headers
Added by IBM contributorIBM on October 10, 2013
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

Certain requests may require headers.

Content type

For requests that transmit data to the server, such as POST and PUT, specify the following request headers. Programming GET requests may also require the Accept header. It does not hurt to include these headers in all requests.

Table 1. Request header values for content type
Name
Value
Content-Type
application/json, text/calendar
Accept
application/json, text/calendar


Authorization

If the server or database restricts access, authorization credentials are required. The following header provides authorization but is not recommended for security reasons.

Table 2. Request header value for authorization
Name
Value
Authorization
username:password (must be encoded)


Other headers may be required for authorization depending on the security imposed by the Domino® server.

The Database collection resource always requires authentication.

Override

If you cannot send a DELETE or PUT request, for example, because of firewall restrictions, send a POST request with one of the following headers.

Table 3. Request header values for override
Name
Value
X-HTTP-Method-Override
DELETE
X-HTTP-Method-Override
PUT


Range

Certain GET operations (for example, View/folder entries GET) may honor the following request headers.

Table 4. Request header values for range
Name
Value
Range
bytes start-end/entityLength


Modification date

A document GET operation honors the following request header. A requested document is returned normally if the last modification date is later than the date specified in the header, or the date specification is invalid. If the modification date is the same or earlier, Status 304 Not Modified is returned.

Table 5. Request header values for modification date for GET
Name
Value
If-Modified-Since
Date and time in RFC 1123 time format, for example, Tue, 23 Aug 2011 21:35:18 GMT, as previously returned in the Last-Modified response header for the same document


A document DELETE, PATCH, or PUT operation honors the following request header. A requested document is processed normally if the last modification date is earlier or the same as the date specified in the header. If the modification date is later, or the date specification is invalid, Status 412 Precondition Failed is returned.

Table 6. Request header values for modification date for DELETE, PATCH, and PUT
Name
Value
If-Unmodified-Since
Date and time in RFC 1123 time format, for example, Tue, 23 Aug 2011 21:35:18 GMT, as previously returned in the Last-Modified response header for the same document


The date-time specification for these request headers must be a value previously returned in the Last-Modified response header of a GET request for the same document. Because the client and server clocks are not necessarily synchronized, you may get unexpected results specifying a client-based date and time.

Language

The following request header is supported for error responses. By default error messages are loaded at the server locale.

Table 7. Request header values for language
Name
Value
Accept-Language
A language code such as fr for French


Parent topic: Accessing IBM Domino Access Services