WARNING: This server provides a static reference view of the NetKernel documentation. Links to dynamic content do not work. For the best experience we recommend you install NetKernel and view the documentation in the live system .

After the HTTP client accessors issue their HTTP protocol requests they receive an HTTP protocol response which includes HTTP response headers.

It is possible to retrieve the HTTP protocol headers by issuing the requests with the method issueRequestForResponse(...) and then retrieving the HTTP protocol headers using the header keys "HTTP_ACCESSOR_STATUS_CODE_METADATA" and "HTTP_ACCESSOR_RESPONSE_HEADERS_METADATA".

For example, the following code issues an HTTP GET protocol request and captures the HTTP response code:

INKFRequest request;
INKFResponseReadOnly response;
Object representation;
int httpReturnCode;

request = context.createRequest("active:httpGet");
request.addArgumentByValue("url", "http://www.mycomp.com");
response = context.issueRequestForResponse(request);
httpReturnCode = response.getHeader("HTTP_ACCESSOR_STATUS_CODE_METADATA");
representation = response.getRepresentation();

Keys

HTTP_ACCESSOR_STATUS_CODE_METADATA

The status code of the HTTP response as an Integer.

HTTP_ACCESSOR_RESPONSE_HEADERS_METADATA

The HTTP response headers for the request as an IHDSNode list structure with the following item

<name>valuename>

Where name is the HTTP header name and value is the header value.