C#
C#
Transition from Http.PText to Http.HttpStr
Provides instructions for replacing deprecated PText method calls with HttpStr.Chilkat C# Downloads
bool success = false;
Chilkat.Http http = new Chilkat.Http();
string verb = "PUT";
string url = "https://example.com/";
string textData = "This is the HTTP request body";
string charset = "utf-8";
string contentType = "text/plain";
// ------------------------------------------------------------------------
// The PText method is deprecated:
Chilkat.HttpResponse responseObj = http.PText(verb,url,textData,charset,contentType,false,false);
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(verb,url,textData,charset,contentType,responseOut);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}