Objective-C Requires Chilkat v11.0.0+
Objective-C
Transition from Http.PBinaryBd to Http.HttpBd
Provides instructions for replacing deprecated PBinaryBd method calls with HttpBd.Chilkat Objective-C Downloads
#import <CkoHttp.h>
#import <NSString.h>
#import <CkoBinData.h>
#import <CkoHttpResponse.h>
BOOL success = NO;
CkoHttp *http = [[CkoHttp alloc] init];
NSString *verb = @"POST";
NSString *url = @"https://example.com/";
CkoBinData *bdRequestBody = [[CkoBinData alloc] init];
NSString *contentType = @"application/octet-stream";
// ------------------------------------------------------------------------
// The PBinaryBd method is deprecated:
CkoHttpResponse *responseObj = [http PBinaryBd: verb url: url data: bdRequestBody contentType: contentType md5: NO gzip: NO];
if (http.LastMethodSuccess == NO) {
NSLog(@"%@",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.
CkoHttpResponse *responseOut = [[CkoHttpResponse alloc] init];
success = [http HttpBd: verb url: url bd: bdRequestBody contentType: contentType response: responseOut];
if (success == NO) {
NSLog(@"%@",http.LastErrorText);
return;
}