skip to main content
Input REST file syntax : Table definition entries : Columns as HTTP headers
  

Try DataDirect Drivers Now

Columns as HTTP headers

A column can be sent as an HTTP header instead of as part of a query string in GET requests. HTTP headers can be specified in the column definition by setting the #header property to true and providing the header using the #eq property. The syntax to send a column as an HTTP header takes the following form:
"<column_name>[]":{"#type":"<data_type>","#header":true,"#default":"<default_filter>","#eq":"<header_name>"}
where:
data_type
(optional) specifies the data type to which the column is mapped.
default_filter
(optional) specifies the value sent with the header that is used to filter results. When this value is specified, the value <header>:<default_filter> is sent in the HTTP request. If the default filter is not specified, a WHERE clause must provide the filter value. For example:
SELECT * FROM authentication WHERE authentication = 'scott/tiger'
header_name
specifies the name of the HTTP header sent in the request.
The following example demonstrates
"service":{"#type":"VarChar","#header":true,"#default":"scott/tiger","#eq":"X-Custom-Auth"}