![]() |
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
(PureBasic) Example: Http.GetLastJsonData methodDemonstrates the Note: This example requires Chilkat v11.0.0 or greater.
IncludeFile "CkHttpResponse.pb" IncludeFile "CkHttp.pb" IncludeFile "CkJsonObject.pb" Procedure ChilkatExample() success.i = 0 http.i = CkHttp::ckCreate() If http.i = 0 Debug "Failed to create object." ProcedureReturn EndIf resp.i = CkHttpResponse::ckCreate() If resp.i = 0 Debug "Failed to create object." ProcedureReturn EndIf ; Only allow TLS 1.2 or better. CkHttp::setCkSslProtocol(http, "TLS 1.2 or higher") success = CkHttp::ckHttpNoBody(http,"GET","https://google.com/",resp) If success = 0 Debug CkHttp::ckLastErrorText(http) CkHttp::ckDispose(http) CkHttpResponse::ckDispose(resp) ProcedureReturn EndIf json.i = CkJsonObject::ckCreate() If json.i = 0 Debug "Failed to create object." ProcedureReturn EndIf CkJsonObject::setCkEmitCompact(json, 0) CkHttp::ckGetLastJsonData(http,json) Debug CkJsonObject::ckEmit(json) ; Output as of Chilkat v11.1.0 ; Additional information may be added as requested or needed in future versions of Chilkat. ; { ; "tls": { ; "params": { ; "sniHostname": "www.google.com", ; "allowConnectionOnlyIfServerChooses": "TLS 1.2 or higher" ; }, ; "negotiatedTlsVersion": "TLS 1.3" ; } ; } CkHttp::ckDispose(http) CkHttpResponse::ckDispose(resp) CkJsonObject::ckDispose(json) ProcedureReturn EndProcedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.