HeadersConfig
HTTP headers config
Fields
Name | Type | Description |
---|---|---|
DefaultRequestHeaders | Array of HttpHeader | Optional. HTTP headers will be sent with all requests. Default value is an empty array |
Initialization String Format
This UDT can’t be configured with a string. Initialization methiods are used instead.
Methods
Methods that help with initialization.
AddHeader
Adds or replaces a header
Syntax
AddHeader( header )
Arguments
Name | Type | Description |
---|---|---|
header | HttpHeader | Required. HTTP header |
Return type
Return value
Returns the instance on which it was called
AppendHeader
Adds a new header or a value to an existing header
Syntax
AppendHeader( name, value )
Arguments
Name | Type | Description |
---|---|---|
name | String | Required. Header name |
value | String | Required. Header value |
Return type
Return value
Returns the instance on which it was called
Examples
Creating a new instance
DECLARE @headersConfig wds.HeadersConfig = '';
DECLARE @httpHeader wds.HttpHeader = 'Name: Accept; Values: text/html';
SET @headersConfig = @headersConfig.AddHeader(@httpHeader);
SET @headersConfig = @headersConfig.AppendHeader('Accept', 'application/xml');
HttpHeader
HTTP header config
Fields
Name | Type | Description |
---|---|---|
Name | String | Required. Header name |
Values | Array of String | Required. Header values |
Initialization String Format
An instance can be initialized with a string of the following format: Name: name; Values: value1, value2;
Examples
Creating a new instance initialized from a string:
DECLARE @httpHeader wds.HttpHeader = 'Name: Accept; Values: text/html, application/xml';