Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to consume rest service?
Message
From
18/11/2019 14:29:25
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
18/11/2019 11:15:17
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01671919
Message ID:
01671921
Views:
77
>Hello all,
>
>I did some searches. and I found some code
>
>Example of making REST GET method call
>
>xmlHttp = CREATEOBJECT("MSXML2.ServerXMLHTTP")
>xmlHttp.open("GET", "put url with parameters here", null)
>xmlHttp.setRequestHeader("Content-Type", "text/xml")
>xmlHttp.send("")
>result = xmlHttp.responseText
>? result
>
>
>Example of making REST POST method call
>
>xmlHttp = CREATEOBJECT("MSXML2.ServerXMLHTTP")
>
>xmlHttp.open("POST", "put URL here", null)
>xmlHttp.setRequestHeader("Content-Type", "text/xml")
>xmlHttp.send("put string to send in body")
>result = xmlHttp.responseText
>? result
>
>
>Should I do my tests with those lines of code or is there something else? a better way to do it?

There are several kinds of interfaces where you don't need to send anything, just navigate to an url, with a bunch of parameters, frequently containing the username, unix time, and a hash of the whole url plus password (but not sending the password itself). Then I'd send it using simple httpGetEx() (from wwipstuff/wwutils by Rick) and get a json back. This you can find in their documentation, just check if the service provider has some API - these locations are the API.

Example: https://api.statcounter.com/docs/v3

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform