Web Connection
REST Whitepaper Sample URL
Gravatar is a globally recognized avatar based on your email address. REST Whitepaper Sample URL
  Steve
  All
  Aug 18, 2025 @ 05:53am

Hi Rick,
I am working through the Building and Consuming REST API Services with Foxpro whitepaper. I am in the "kick the tires" section and trying to execute the first GET Request. I get the following error: "Property GET is not found"

I have verified the loHttp object is getting created. Is the referenced REST API still active? Also, if I enter the referenced URL into my browser, https://albumviewer.west-wind.com/api/artist/1, I do get a JSON response. Any ideas?

TIA,
Steve

DO wwHttp  && load libraries
loHttp = CREATEOBJECT("wwHttp")

*** GET Request
lcResult = loHttp.Get("https://albumviewer.west-wind.com/api/artist/1")
? PADR(lcResult,1200)
Gravatar is a globally recognized avatar based on your email address. re: REST Whitepaper Sample URL
  Rick Strahl
  Steve
  Aug 18, 2025 @ 09:15am

You likely need a newer version of the West Wind Client Tools or Web Connection. The various Verb methods (.Get(), .Post(), .Delete(), .Put() etc) got implemented somewhere around v8.0.

You can use .HttpGet() instead which is the old more explicit syntax - the verb methods are just wrappers around this method setting the properties and the post buffer manually. For .Get() the syntax with .HttpGet() is identical. For methods with data, you have to set the verb and .AddPostKey() the values yourself.

+++ Rick +++

Gravatar is a globally recognized avatar based on your email address. re: REST Whitepaper Sample URL
  Steve
  Rick Strahl
  Aug 18, 2025 @ 09:28am

Thanks Rick. Yep, I had just come to that conclusion right before your email. I was moving on to the Json Serialization and saw that my version was outdated based on parameters being passed. Then it dawned on me, and I tried the HttpGet() approach, and it worked!

Yes, it's past time for me to upgrade which has been on my list for a while. 😃

Thanks again!

© 1996-2025