Siebel CRM Desktop for IBM Notes Administration Guide > Customizing Authentication > CRM Desktop SSO Objects You Can Customize >

Header Object


The header object includes the HTTP headers of a request or response. It is read-only for a response and writable for a request. It includes the following functions:

  • get_header_count. Gets the number of headers that the request or response contains.
  • get_string_value. Gets all headers as a single string.

Get Header Name Function

The get_header_name function gets the name of a header. It uses the following format:

get_header_name(index)

where:

  • index is a numeric value that identifies the header index. This index starts with 0 as the first value. To access the first header, you use an index value of 0. To access the second header, you use an index value of 1, and so forth.

For example, the following code gets the name of the first header:

var header = req.get_headers().get_header_name(0);

Get Header Value Function

The get_header_value function gets the value of a header. It uses the following format:

get_header_value(index)

where:

  • index is a numeric value that identifies the header index. This index starts with 0 as the first value. To access the first header, you use an index value of 0. To access the second header, you use an index value of 1, and so forth.

For example, the following code gets the value of the first header:

var header_val = req.get_headers().get_header_value(0);.

Add Header Function

The add_header function adds a new header. You can use it only for a request. You cannot use it for a reply. It uses the following format:

add_header(name, value)

where:

  • name is a string that contains the header name.
  • value is a string that contains the header value.

For example, the following code adds the content type for the request:

req.get_headers().add_header("Content-Type", "text/html");

For more information, see Request Object and Response Object.

Siebel CRM Desktop for IBM Notes Administration Guide Copyright © 2018, Oracle and/or its affiliates. All rights reserved. Legal Notices.