West Wind .NET Tools and Demos
Retrieving a JSON string
Gravatar is a globally recognized avatar based on your email address. Retrieving a JSON string
  Bruce Rowe
  All
  Aug 27, 2023 @ 06:51pm

I can go to my browser and enter a text string: https://api.dev7.centerstage.com/wintix/payments/stripe/getTerminals

I get a nice response in JSON in my browser: [{"id":"tmr_FOSPmQAANweQBr","name":"Bruce's terminal"}]

But in Foxpro, I cannot retrieve the string. I have tried: ```foxpro lcWebtixSitehttps://api.dev7.centerstage.com/wintix/payments/stripe/getTerminals

loHttp=CREATEOBJECT("wwHTTP")

lcHTML = loHttp.HTTPGet(lcWebtixSite)

messagebox( lcHTML )

But all I get is a blank page. Does anyone know what I am doing wrong?

Thanks.

Gravatar is a globally recognized avatar based on your email address. re: Retrieving a JSON string
  Rick Strahl
  Bruce Rowe
  Aug 28, 2023 @ 01:56pm

When I go to that page I get OK as a message, same as I get if I run your code with the wwHttp.Get() or HttpGet().

You probably have to be logged in to get the JSON content, so you need the cookie or other auth that is related to that.

+++ Rick ---

Gravatar is a globally recognized avatar based on your email address. re: Retrieving a JSON string
  Bruce Rowe
  Rick Strahl
  Aug 28, 2023 @ 05:54pm

The mystery has been solved. I needed to include the "https://" with the name of the site. Once I did that, everything worked. Thanks Rick.

© 1996-2024