![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Objective-C) Transition from Http.PutBinary to Http.HttpBinaryProvides instructions for replacing deprecated PutBinary method calls with HttpBinary. Note: This example requires Chilkat v11.0.0 or greater.
#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; |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.