Node.js
Node.js
Transition from Http.PBinaryBd to Http.HttpBd
Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.Chilkat Node.js Downloads
NODEJS_PRELUDE
function chilkatExample() {
var success = false;
var http = new chilkat.Http();
var verb = "POST";
var url = "https://example.com/";
var bdRequestBody = new chilkat.BinData();
var contentType = "application/octet-stream";
// ------------------------------------------------------------------------
// The PBinaryBd method is deprecated:
// responseObj: HttpResponse
var responseObj = http.PBinaryBd(verb,url,bdRequestBody,contentType,false,false);
if (http.LastMethodSuccess == false) {
console.log(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.
var responseOut = new chilkat.HttpResponse();
success = http.HttpBd(verb,url,bdRequestBody,contentType,responseOut);
if (success == false) {
console.log(http.LastErrorText);
return;
}
}
chilkatExample();