Sample code for 30+ languages & platforms
C#

Transition from Http.PostXml to Http.HttpStr

Provides instructions for replacing deprecated PostXml method calls with HttpStr.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Http http = new Chilkat.Http();

string url = "https://example.com/something";
string requestBodyXml = "<something>...</something>";
string charset = "utf-8";

//  ------------------------------------------------------------------------
//  The PostXml method is deprecated:

Chilkat.HttpResponse responseObj = http.PostXml(url,requestBodyXml,charset);
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using HttpStr.
//  Your application creates a new, empty HttpResponse object which is passed 
//  in the last argument and filled upon success.

Chilkat.HttpResponse responseOut = new Chilkat.HttpResponse();
success = http.HttpStr("POST",url,requestBodyXml,charset,"application/xml",responseOut);
if (success == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}