Thursday, June 7, 2012

Using WebClient to POST Http Data


WebClient webClient = new WebClient();
webClient.Headers["Content-type"] = "text/xml";
string content = File.ReadAllText(xmlFilePath);
string HtmlResult = webClient.UploadString(uri, content);
// For other content types, use webClient.UploadData()