![]() |
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) Delete a Task ListDemonstrates how to delete a Google task list. Note: This example requires Chilkat v11.0.0 or greater.
func chilkatTest() { var success: Bool = false // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. // Get the previously obtained access token. // See Get Google Tasks Access Token. let fac = CkoFileAccess()! var accessToken: String? = fac.readEntireTextFile("qa_data/tokens/googleTasks.txt", charset: "utf-8") if fac.lastMethodSuccess == false { print("\(fac.lastErrorText!)") return } let http = CkoHttp()! http.authToken = accessToken // Delete the task list with this ID: MDM4MzQ4NTA3NDQwMDUxMzQ2OTQ6OTk5Njk3NjkxNzg4Nzg2NDow http.setUrlVar("taskListId", value: "MDM4MzQ4NTA3NDQwMDUxMzQ2OTQ6OTk5Njk3NjkxNzg4Nzg2NDow") let resp = CkoHttpResponse()! success = http.httpNoBody("DELETE", url: "https://www.googleapis.com/tasks/v1/users/@me/lists/{$taskListId}", response: resp) if success == false { print("\(http.lastErrorText!)") return } // Show the response body. (empty for success) print("\(resp.bodyStr!)") // Examine the response status code. (204 = success) print("response status code: \(resp.statusCode.intValue)") } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.