Skip to content

GetHeader

Returns the value of a specified header.

1
myRestResponse.GetHeader(name: string):any

Parameters

string name
    The name of the header.

Returns

The first value of the header if found; otherwise, null.

Remarks

The header name is compared case-sensitively.

Examples

Read the location of a created resource

1
2
3
4
5
6
var response = $Rest.Create('https://api.example.com/')
    .Request('tickets', { title : $Xml.Evaluate('Subject') })
    .Expect('Created')
    .Post();

$Xml.SetValue('TicketUrl', response.GetHeader('Location'));