Hi everyone,
What i am trying to do here is make post request to Rest webserivce with xml data.
this is what i have right now but i am not sure how to pass my xml data
XElement xml = new XElement("MatchedOptions",
from m in _matchedOptionsList
select new XElement("Listing",
new XElement("DomainID", _trafficCopInputs.DomainID),
new XElement("AdSource", _trafficCopInputs.AdSource),
new XElement("Campaign", _trafficCopInputs.Campaign),
new XElement("AdGroup", _trafficCopInputs.AdGroup),
new XElement("RedirectURL", m.RedirectPath),
new XElement("FunnelKeyword", m.FunnelKeyword)));
HttpWebRequest req = WebRequest.Create("http://something.com/")
as HttpWebRequest;
req.Method = "POST";
req.ContentType = "text/xml";
req.ContentLength = 0;
StreamWriter writer = new StreamWriter(req.GetRequestStream());
writer.WriteLine(xml.ToString());