Micro Focus Email

Send E-mail

Self-Solve Knowledge Search

How to add a custom header to Ajax TruClient script

How to add a custom header to Ajax TruClient script

How to add a custom header to Ajax TruClient script

How to add a custom header to Ajax TruClient script
B-SL:100 HPSL:100 LIB4:false TYPE:howto HPTYPE:technical_documents ATT:1

Summary

Example of how to add your own header to the requests of an Ajax TruClient script.

This article gives an example of how to add your own custom header to the Ajax TruClient requests.

Solution

Use the Utils.addAutoHeader API that comes with Ajax TruClient.

Utils.addAutoHeader (header, value, merge);

  • header: The name of the header to be added.
  • value: The value of the header to be added.
  • merge: True value indicates to merge the value with an existing header by the same name, false indicates to overwrite it.

In Development mode of the script, add a "Evaluate JavaScript" step with the required parameters.

Example:

Utils.addAutoHeader

In order to stop adding the custom header to your requests, use "Utils.removeAutoHeader(header)", where header is the name of the header to be removed.

Additional Information

Was this document helpful? Feedback