![]() |
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
(Unicode C) Example: Http.QuickGetSb methodDemonstrates the
#include <C_CkHttpW.h> #include <C_CkStringBuilderW.h> void ChilkatSample(void) { BOOL success; HCkHttpW http; HCkStringBuilderW sb; success = FALSE; http = CkHttpW_Create(); // Send the HTTP GET and return the content in a StringBuilder sb = CkStringBuilderW_Create(); success = CkHttpW_QuickGetSb(http,L"https://www.chilkatsoft.com/helloWorld.json",sb); if (CkHttpW_getLastMethodSuccess(http) == FALSE) { if (CkHttpW_getLastStatus(http) == 0) { // Communications error. We did not get a response. wprintf(L"%s\n",CkHttpW_lastErrorText(http)); } else { wprintf(L"Response status code: %d\n",CkHttpW_getLastStatus(http)); wprintf(L"Response body error text:\n"); wprintf(L"%s\n",CkStringBuilderW_getAsString(sb)); } CkHttpW_Dispose(http); CkStringBuilderW_Dispose(sb); return; } // The downloaded content: wprintf(L"%s\n",CkStringBuilderW_getAsString(sb)); wprintf(L"Success\n"); CkHttpW_Dispose(http); CkStringBuilderW_Dispose(sb); } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.