White Papers
Your Foxpro/Rest Whitepaper
Gravatar is a globally recognized avatar based on your email address. Your Foxpro/Rest Whitepaper
  Kevin v Emmrich
  All
  Mar 7, 2024 @ 03:42am

Rick, I am looking at your whitepaper "Building and Consuming REST API Services with FoxPro" from Oct 2021 and I was wondering what is the earliest WC version that is required. I am using 4.6 and/or 5.4.3 and I am getting this error on this example:

DO wwHttp  && load libraries

loHttp = CREATEOBJECT("wwHttp")

*** GET Request
lcResult = loHttp.Get("https://albumviewer.west-wind.com/api/artist/1")
? PADR(lcResult,1200)

The error is "Property 'Get' is not found"

Thanks in advance, Kevin

Gravatar is a globally recognized avatar based on your email address. re: Your Foxpro/Rest Whitepaper
  Rick Strahl
  Kevin v Emmrich
  Mar 7, 2024 @ 01:30pm

The examples use Web Connection 7.0 and later although I think some of the new HTTP features were added sometime in the late 6.x cycle. You can use HttpGet() and AddPostKey() in older versions - the new methods - Get(), Post(), Put() and Delete() - are merely convenience methods that wrap the HttpGet() and make it easier to make these calls more easily.

Regardless - I think those old versions don't include the JSON parser if I recall - that was introduced in 6.0 and there have been many improvements in this space since the original release.

+++ Rick ---

© 1996-2024