![]() |
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
(Swift) 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.
func chilkatTest() { var success: Bool = false let http = CkoHttp()! var verb: String? = "PUT" var url: String? = "https://example.com/" var byteData: NSData var contentType: String? = "application/octet-stream" // ------------------------------------------------------------------------ // The PutBinary method is deprecated: var responseBody: String? = http.putBinary(url, byteData: byteData, contentType: contentType, md5: false, gzip: false) if http.lastMethodSuccess == false { print("\(http.lastErrorText!)") return } // ... // ... // ------------------------------------------------------------------------ // Do the equivalent using HttpBinary. let responseOut = CkoHttpResponse()! success = http.httpBinary(verb, url: url, byteData: byteData, contentType: contentType, response: responseOut) if success == false { print("\(http.lastErrorText!)") return } responseBody = responseOut.bodyStr } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.