Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(PowerBuilder) Magento Request with OAuth1.0a AuthenticationDemonstrates sending a Magento request with OAuth1.0a authentication. (Using the Magento 1.x REST API)
integer li_rc integer li_Success oleobject loo_Http string ls_Url string ls_JsonStr oleobject loo_Json // This example requires the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if loo_Http.OAuth1 = 1 loo_Http.OAuthVerifier = "" loo_Http.OAuthConsumerKey = "MAGENTO_CONSUMER_KEY" loo_Http.OAuthConsumerSecret = "MAGENTO_CONSUMER_SECRET" loo_Http.OAuthToken = "MAGENTO__TOKEN" loo_Http.OAuthTokenSecret = "MAGENTO_TOKEN_SECRET" loo_Http.Accept = "application/json" ls_Url = "http://www.inart.com/api/rest/products/store/2?limit=20&page=1" ls_JsonStr = loo_Http.QuickGetStr(ls_Url) if loo_Http.LastMethodSuccess <> 1 then Write-Debug loo_Http.LastErrorText destroy loo_Http return end if Write-Debug "Response status code = " + string(loo_Http.LastStatus) loo_Json = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") loo_Json.Load(ls_JsonStr) loo_Json.EmitCompact = 0 Write-Debug loo_Json.Emit() // Use this online tool to generate parsing code from sample JSON: // Generate Parsing Code from JSON destroy loo_Http destroy loo_Json |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.