Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Call Web API RESTful from VFP 9 app?
Message
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01629204
Message ID:
01629235
Views:
221
Thank you very much.

>As others have pointed out West Wind Client Tools has support for making the HTTP as well as support for helping you deseraize the JSON data returned (or any that you may have to send). While there are other tools for doing HTTP calls with VFP, wwHttp has a bunch of additional features to facilitate sending and receiving data, plus tools to actually do something with the data that comes back - like deserializing and serializing JSON in the case of a typical REST service.
>
>
>DO wwHttp
>DO wwJsonSerializer
>
>loSer = CREATEOBJECT("wwJsonSerializer")
>lcJsonIn = loSer.Serialize(loPostObject)    && Some object or value to serialize
>
>loHttp = CREATEOBJECT("wwHttp")
>loHttp.cContentType = "application/json"
>* loHttp.cHTTPVerb = "POST"  && not required for GET/POST but use for  PUT/DELETE/HEAD/OPTIONS etc,
>loHttp.AddPostKey(lcJsonIn)  && raw post data
>
>lcJsonResult = loHttp.HttpGet(lcUrl)
>
>loResultObject = loSer.DeserializeJson(lcJsonResult)
>
>*** Do something with the result object
>? loResultObject.status
>? loResultObject.Data.SummaryValue
>
>
>
>More info:
>
>* Access HTTP content from the Web
>* wwJsonSerializer Class
>
>
>+++ Rick ---
>
>>Do you know if it is possible to call Web API RESTful (built on .NET) service from VFP 9 app? I am talking about passing a couple of values from VFP 9 app to the Web API?
>>
>>TIA
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Reply
Map
View

Click here to load this message in the networking platform