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

SQL Anywhere 11.0.1 » SQL Anywhere Server - SQL Reference » System Objects » System procedures » Alphabetical list of system procedures


sa_set_http_header system procedure

Permits a web service to set an HTTP header in the result.

  • fldname   Use this CHAR(128) parameter to specify a string containing the name of one of the HTTP header fields.

  • val   Use this LONG VARCHAR parameter to specify the value to which the named parameter should be set.


Setting the special header field @HttpStatus sets the status code returned with the request. The status code is also known as the response code. For example, the following command sets the status code to 404 Not Found.

CALL dbo.sa_set_http_header( '@HttpStatus', '404' );

The body of the error message is inserted automatically. Only valid HTTP error codes can be used. Setting the status to an invalid code causes a SQL error.

With the exception of the Connection response header, response headers generated automatically by the database server can be removed. For example, the following command removes the Expires response header:

CALL dbo.sa_set_http_header( 'Expires', NULL );


Side effects


See also

The following example sets the Content-Type header field to text/html.

CALL dbo.sa_set_http_header( 'Content-Type', 'text/html' );