Sample code for 30+ languages & platforms
C#

Transition from Http.PutBinary to Http.HttpBinary

Provides instructions for replacing deprecated PutBinary method calls with HttpBinary.

Chilkat C# Downloads

C#
bool success = false;

Chilkat.Http http = new Chilkat.Http();

string verb = "PUT";
string url = "https://example.com/";
byte[] byteData = null;
string contentType = "application/octet-stream";

//  ------------------------------------------------------------------------
//  The PutBinary method is deprecated:

string responseBody = http.PutBinary(url,byteData,contentType,false,false);
if (http.LastMethodSuccess == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

//  ...
//  ...

//  ------------------------------------------------------------------------
//  Do the equivalent using HttpBinary.

Chilkat.HttpResponse responseOut = new Chilkat.HttpResponse();
success = http.HttpBinary(verb,url,byteData,contentType,responseOut);
if (success == false) {
    Debug.WriteLine(http.LastErrorText);
    return;
}

responseBody = responseOut.BodyStr;