Objective-C Requires Chilkat v11.0.0+
Objective-C
Transition from Http.PutBinary to Http.HttpBinary
Provides instructions for replacing deprecated PutBinary method calls with HttpBinary.Chilkat Objective-C Downloads
#import <CkoHttp.h>
#import <NSString.h>
#import <CkoHttpResponse.h>
BOOL success = NO;
CkoHttp *http = [[CkoHttp alloc] init];
NSString *verb = @"PUT";
NSString *url = @"https://example.com/";
NSData byteData;
NSString *contentType = @"application/octet-stream";
// ------------------------------------------------------------------------
// The PutBinary method is deprecated:
NSString *responseBody = [http PutBinary: url byteData: byteData contentType: contentType md5: NO gzip: NO];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",http.LastErrorText);
return;
}
// ...
// ...
// ------------------------------------------------------------------------
// Do the equivalent using HttpBinary.
CkoHttpResponse *responseOut = [[CkoHttpResponse alloc] init];
success = [http HttpBinary: verb url: url byteData: byteData contentType: contentType response: responseOut];
if (success == NO) {
NSLog(@"%@",http.LastErrorText);
return;
}
responseBody = responseOut.BodyStr;