Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to consume rest service?
Message
From
18/11/2019 11:15:17
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
How to consume rest service?
Miscellaneous
Thread ID:
01671919
Message ID:
01671919
Views:
85
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?
*******************************************************
Save a tree, eat a beaver.
Denis Chassé
Next
Reply
Map
View

Click here to load this message in the networking platform