Sample code for 30+ languages & platforms
PHP Extension

Transition from Http.PBinaryBd to Http.HttpBd

Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.

Chilkat PHP Extension Downloads

PHP Extension
<?php

include("chilkat.php");

$success = false;

$http = new CkHttp();

$verb = 'POST';
$url = 'https://example.com/';
$bdRequestBody = new CkBinData();
$contentType = 'application/octet-stream';

// ------------------------------------------------------------------------
// The PBinaryBd method is deprecated:

// responseObj is a CkHttpResponse
$responseObj = $http->PBinaryBd($verb,$url,$bdRequestBody,$contentType,false,false);
if ($http->get_LastMethodSuccess() == false) {
    print $http->lastErrorText() . "\n";
    exit;
}

// ...
// ...

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

$responseOut = new CkHttpResponse();
$success = $http->HttpBd($verb,$url,$bdRequestBody,$contentType,$responseOut);
if ($success == false) {
    print $http->lastErrorText() . "\n";
    exit;
}


?>