com.HTTPServiceRequest.setResponseHeader

Defines a header for the HTTP response.

Syntax

setResponseHeader(
   name STRING,
   value STRING )
  1. name is the name of a header to define.
  2. value is the value of a header to define.

Usage

The setResponseVersion() method sets (or replaces) the name and value of a HTTP response header.

The Content-Length header cannot be set, because it is computed internally according to the body size.

The method must be called before sending the response with one of sendResponse, sendTextResponse, sendXmlResponse, or beginXmlResponse and endXmlResponse methods.

In case of error, the method throws an exception and sets the STATUS variable. Depending on the error, a human-readable description of the problem is available in the SQLCA.SQLERRM register. See Error handling in GWS calls (STATUS).