Skip to content

AddXml

Adds new XML content to the request.

myRestRequest.AddXml(xml: ( string | Xml )):RestRequest (Xml, RestRequest)

Parameters

( string | Xml ) xml
    The XML content to add.

Returns

The current RestRequest instance.

Remarks

The XML is serialized as the request body, the request format is set to XML, and the request method is set to POST.

Example

1
2
3
4
5
6
var client = $Rest.Create('http://targetserver');
var request = client.Request();

request.AddXml($Xml.SelectSingle('Input'));

var result = request.ExecuteXml($Xml);

See Also