Accessing HTTP Custom Headers (Magic xpi 4.13)
Apart from the standard HTTP Headers, custom HTTP Headers can also be used with Magic xpi. The custom HTTP Headers, defined in name and value pairs (For example: Reference1=Test), can be set by using any HTTP client like, Postman, SOAP UI and so on. The custom Headers which are set at the client-side can be accessed in the Magic xpi server.
-
Before using the custom headers, the user needs to define them in the mgreq.ini file under the parameter HttpVars. The prefix HTTP needs to be added to the Header name. For example: HTTP_Reference1.
Multiple headers can be added as comma-separated values.
For example: HttpVars = HTTP_Reference1, HTTP_Reference2
-
Once the headers are defined, the value for the Header can be accessed using the GetParam function in the expression editor.
For example: GetParam ('HTTP_Reference1')
|
The IIS server needs to be restarted for the custom Headers configuration to take effect.
|