![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java JavaScript 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.QuickGetSb methodDemonstrates the
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(); // Send the HTTP GET and return the content in a StringBuilder CkStringBuilder sb = new CkStringBuilder(); success = http.QuickGetSb("https://www.chilkatsoft.com/helloWorld.json",sb); if (http.get_LastMethodSuccess() == false) { if (http.get_LastStatus() == 0) { // Communications error. We did not get a response. System.out.println(http.lastErrorText()); } else { System.out.println("Response status code: " + http.get_LastStatus()); System.out.println("Response body error text:"); System.out.println(sb.getAsString()); } return; } // The downloaded content: System.out.println(sb.getAsString()); System.out.println("Success"); } } |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.