Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to consume rest service?
Message
From
18/11/2019 17:20:32
 
 
To
18/11/2019 14:29:25
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01671919
Message ID:
01671922
Views:
67
Thank you Dragan.

>>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
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Previous
Reply
Map
View

Click here to load this message in the networking platform