function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AbAb 

Sending request in XML format | constructing XML node in SF

Hello,

How to send a request in XML format.
 
<address>
    <name>Kirk Stevens</name>
    <street1>808 State St</street1>
    <street2>Apt. 2</street2>
    <city>Palookaville</city>
    <state>PA</state>
    <country>USA</country>
</address>

I want to add the above XML in the request i send
<address>
    <name>Kirk Stevens</name>
    <street1>808 State St</street1>
    <street2>Apt. 2</street2>
    <city>Palookaville</city>
    <state>PA</state>
    <country>USA</country>
</address>

HTTP h = new HTTP();
HTTPRequest req = new HTTPRequest();
req.setMethod('GET');
HTTPResponse resp = req.send(req);
Best Answer chosen by Ab
logontokartiklogontokartik
Maybe this post will help, generally you use XMLStreamWriter Class to create the XML request. but there are other ways this blog is explaining which is very interesting. Check it out

http://it.toolbox.com/blogs/anything-worth-doing/a-better-way-to-generate-xml-on-salesforce-using-visualforce-55433