Skip to content

ExecuteXmlAsync

Executes the request asynchronously and returns the response body as an XML node.

1
myRestRequest.ExecuteXmlAsync(contextNode?: Xml):Promise<Xml>

Parameters

Xml contextNode optional
    Optional XML node whose namespace and schema context is used while parsing the response.

Returns

A Promise that resolves to the response body as an Xml node.

Remarks

The response status is verified like RestRequest.ExecuteXml.

Examples

Read XML asynchronously

1
2
3
4
5
6
$Rest.Create('https://rates.example.com/')
    .Request('today.xml')
    .ExecuteXmlAsync()
    .then(function (rates) {
        $Xml.SetValue('Rate', rates.Evaluate("Currency[@Code='USD']/Rate"));
    });

See Also