FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Consuming a Restful Web Service in Fivewin.
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Consuming a Restful Web Service in Fivewin.
Posted: Wed Dec 02, 2015 04:50 AM

Second post, I was thinking I didn't state my question clearly.

I would think that working with restful web services would be very popular to fivewin programmers.
Is anybody doing this.

I have been playing around with WinHttp.WinHttpRequest.5.1 but this seems old.
The SetCredentials doesn't work past Windows XP.

This seems like it would be the pathway to Web Based Win-Forms Applications.
Is this possible right now in Fivewin, or does something need to be developed.

Thanks,

Byron ...

Thanks,

Byron Hopp

Matrix Computer Services
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Consuming a Restful Web Service in Fivewin.
Posted: Wed Dec 02, 2015 05:52 AM

I know this much that there are some programmers who used Fivewin successfully with REST.
I also understand FWH as such is adequate for this without any external libs.
Those programmers with experience in this subject may be able to throw more light on this.

Regards



G. N. Rao.

Hyderabad, India
Posts: 1335
Joined: Fri Jun 13, 2008 11:04 AM
Re: Consuming a Restful Web Service in Fivewin.
Posted: Wed Dec 02, 2015 06:42 AM
viewtopic.php?f=6&t=25471&hilit=%27MSXML2.XMLHTTP%27

Code (fw): Select all Collapse
   Try
        oOle := CreateObject( 'MSXML2.XMLHTTP' )
    Catch
        oOle := CreateObject( 'Microsoft.XMLHTTP' )
    End
    oOle:Open( 'GET', "YourURL", .f. )
    
    oOle:SetRequestHeader( "Content-Type","application/json") /* if its json*/

    oOle:SetRequestHeader( "Authorization","YourAuthorization Key")
    
    oOle:Send( cJson )
    SysRefresh()
   cRet := oOle:ResponseBody /* Result from the Server*/


It will depend on the RESTful service that you are going to use. For eg the parameters that it expects in the header. Depending on that you may have to use the appropriate value in the oOle:SetRequestHeader()

Hope it is clear.

Regards

Anser
Posts: 408
Joined: Sun Nov 06, 2005 03:55 PM
Re: Consuming a Restful Web Service in Fivewin.
Posted: Wed Dec 02, 2015 08:17 PM

Thank you both for the response.
I will start messing around with the example.

Åšubh krisamas

Thanks,

Byron Hopp

Matrix Computer Services

Continue the discussion