Chilkat HOME Android™ Classic ASP C C++ C# Mono C# .NET Core C# C# UWP/WinRT DataFlex Delphi ActiveX Delphi DLL Visual FoxPro Java Lianja MFC Objective-C Perl PHP ActiveX PHP Extension PowerBuilder PowerShell PureBasic CkPython Chilkat2-Python Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ Visual Basic 6.0 VB.NET VB.NET UWP/WinRT VBScript Xojo Plugin Node.js Excel Go
(MFC) Woo Commerce Authenticate with Query ParamsSee more WooCommerce ExamplesDemonstrates how to authenticate with Woo Commerce over HTTPS using query params instead of HTTP Basic Authentication. For more information, see https://woocommerce.github.io/woocommerce-rest-api-docs/#authentication-over-https
#include <CkHttp.h> #include <CkStringBuilder.h> void ChilkatSample(void) { CkString strOut; // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkHttp http; // To authentication over HTTPS using query params, put the query params in the URL. CkStringBuilder sbResponseBody; bool success = http.QuickGetSb("https://example.com/wp-json/wc/v3/products?consumer_key=ck_52bf39999999999999999999999999999996da4d&consumer_secret=cs_6e8bb99999999999999999999999999999997054",sbResponseBody); if (success == false) { strOut.append(http.lastErrorText()); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } strOut.append("Response Body:"); strOut.append("\r\n"); strOut.append(sbResponseBody.getAsString()); strOut.append("\r\n"); int respStatusCode = http.get_LastStatus(); strOut.append("Response Status Code = "); strOut.appendInt(respStatusCode); strOut.append("\r\n"); if (respStatusCode >= 400) { strOut.append("Response Header:"); strOut.append("\r\n"); strOut.append(http.lastHeader()); strOut.append("\r\n"); strOut.append("Failed."); strOut.append("\r\n"); SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); return; } SetDlgItemText(IDC_EDIT1,strOut.getUnicode()); } |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.