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