Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
REST web service
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Application:
Desktop
Miscellaneous
Thread ID:
01663216
Message ID:
01665045
Views:
128
>>Hello all,
>>
>>Can you provide free code so I can access a REST web service. I searched a bit and found out about Chilkat or West Wind but those are not free.
>>
>>I am using TwilioX and it works great. I guess that LibCurl could be used to access a web Service? Can anybody tell me how I could access a REST web service this way?
>
>Hi,
>
>COM object WinHttp.WinHttpRequest.5.1 is your friend.
>REST API are HTTP GET and POST requirements.
>
>MartinaJ

Hello Martina,

I am trying to use this COM Object to test a webservice, thinking I should use something like GetResponse(). However it does not exist a method like that, only GetResponseHeader(), which is not what I would have expected.

What I did so far, but without success, is to get a list as in this example:
https://api.predic8.de/shop/products/

So I tried it like the following:
req = CreateObject("WinHttp.WinHttpResponse.5.1")
req.Open("POST", "https://api.predic8.de/shop/products/", .F.)
req.SetRequestHeader("Content-type", "application/x-www-form-urlencoded")
MESSAGEBOX(req.Send())
MESSAGEBOX(req.ResponseText)
Send() returns null, ResponseText contains an error, because it expected data to be sent. So I wonder if this is the complete wrong approach, or I am trying with the wrong api, or i am missing something?
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform