Objective-C Requires Chilkat v11.0.0+
Objective-C
Transition from Http.PostBinary to Http.HttpBinary
Provides instructions for replacing deprecated PostBinary 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 = @"POST";
NSString *url = @"https://example.com/";
NSData byteData;
NSString *contentType = @"application/octet-stream";
// ------------------------------------------------------------------------
// The PostBinary method is deprecated:
NSString *responseBody = [http PostBinary: 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;