Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Go) SugarCRM LogoutDemonstrates how to logout of a session.
rest := chilkat.NewRest() var success bool success = rest.Connect("your.site.domain",443,true,true) if success != true { fmt.Println(rest.LastErrorText()) rest.DisposeRest() return } rest.AddHeader("Cache-Control","no-cache") rest.AddHeader("OAuth-Token","<access_token>") sbReq := chilkat.NewStringBuilder() sbJson := chilkat.NewStringBuilder() success = rest.FullRequestSb("POST","/rest/v10/oauth2/logout",sbReq,sbJson) if success != true { fmt.Println(rest.LastErrorText()) rest.DisposeRest() sbReq.DisposeStringBuilder() sbJson.DisposeStringBuilder() return } if rest.ResponseStatusCode() != 200 { fmt.Println("Received error response code: ", rest.ResponseStatusCode()) fmt.Println("Response body:") fmt.Println(*sbJson.GetAsString()) rest.DisposeRest() sbReq.DisposeStringBuilder() sbJson.DisposeStringBuilder() return } json := chilkat.NewJsonObject() json.LoadSb(sbJson) // The following code parses the JSON response. // A sample JSON response is shown below the sample code. var success bool success = json.BoolOf("success") // A sample JSON response body that is parsed by the above code: // { // "success": true // } fmt.Println("Example Completed.") rest.DisposeRest() sbReq.DisposeStringBuilder() sbJson.DisposeStringBuilder() json.DisposeJsonObject() |
© 2000-2023 Chilkat Software, Inc. All Rights Reserved.