(C#) Transition from Http.PBinaryBd to Http.HttpBd
Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd. Note: This example requires Chilkat v11.0.0 or greater.
Chilkat.Http http = new Chilkat.Http();
string verb = "POST";
string url = "https://example.com/";
Chilkat.BinData bdRequestBody = new Chilkat.BinData();
string contentType = "application/octet-stream";
// ------------------------------------------------------------------------
// The PBinaryBd method is deprecated:
Chilkat.HttpResponse responseObj = http.PBinaryBd(verb,url,bdRequestBody,contentType,false,false);
if (http.LastMethodSuccess == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using HttpBd.
// 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();
bool success = http.HttpBd(verb,url,bdRequestBody,contentType,responseOut);
if (success == false) {
Debug.WriteLine(http.LastErrorText);
return;
}
|