![]() |
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
(Java) Example: Http.GetLastJsonData methodDemonstrates the Note: This example requires Chilkat v11.0.0 or greater.
import com.chilkatsoft.*; public class ChilkatExample { static { try { System.loadLibrary("chilkat"); } catch (UnsatisfiedLinkError e) { System.err.println("Native code library failed to load.\n" + e); System.exit(1); } } public static void main(String argv[]) { boolean success = false; CkHttp http = new CkHttp(); CkHttpResponse resp = new CkHttpResponse(); // Only allow TLS 1.2 or better. http.put_SslProtocol("TLS 1.2 or higher"); success = http.HttpNoBody("GET","https://google.com/",resp); if (success == false) { System.out.println(http.lastErrorText()); return; } CkJsonObject json = new CkJsonObject(); json.put_EmitCompact(false); http.GetLastJsonData(json); System.out.println(json.emit()); // 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" // } // } } } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.