C#
C#
HTTP Post XML
Demonstrates how to POST XML to a website.Chilkat C# Downloads
bool success = false;
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.
Chilkat.Http http = new Chilkat.Http();
// Make sure to replace the URL with something real...
string url = "https://example.com/example.asp";
string xmlBody = "<test>This is the XML to be sent</test>";
Chilkat.HttpResponse resp = new Chilkat.HttpResponse();
success = http.HttpStr("POST",url,xmlBody,"utf-8","application/xml",resp);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
// Examine the body of the response.
Debug.WriteLine(resp.BodyStr);