Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Reference » SQL Functions » Alphabetical list of functions

HTTP_ENCODE function [HTTP] Next Page

HTTP_HEADER function [HTTP]


Gets the value of an HTTP header.

Syntax

HTTP_HEADER( header-field-name )

Parameters

header-field-name    The name of an HTTP header field.

Remarks

This function returns the value of the named HTTP header field, or NULL if not called from an HTTP service. It is used when processing an HTTP request via a web service.

If a header for the given header-field-name does not exist, the return value is NULL. The return value is also NULL when the function is not called from a web service.

Some headers that may be of interest when processing an HTTP web service request include the following. More information on these headers is available at [external link] http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html.org/Protocols/rfc2616/rfc2616-sec14.html.

Three special headers are always defined when processing an HTTP web service request:

These special headers allow access to the first line of a client request (also known as the request line).

See also
Standards and compatibility
Example

The following example gets the Cookie header value:

SET cookie_value = HTTP_HEADER( 'Cookie' );

The following example returns the value of the first HTTP header.

DECLARE header_name LONG VARCHAR;
DECLARE header_value LONG VARCHAR;
SET header_name = NEXT_HTTP_HEADER( NULL );
SET header_value = HTTP_HEADER( header_name );