--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-users+unsubscribe@googlegroups.com
Web: http://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi Milan,
Do you need:
1. Build your REST server with Harbour
2. Build your clients with Harbour
In case of 1. :
If you need build your REST server with Harbour then check the Harbor contrib for an
https server at https://github.com/vszakats/harbour-core/tree/master/contrib/hbhttpd,
it has already a simple example on how to build your own eshop, with login access,
list of products and your cart, simple and elegant by Mindaugas Kavaliuskas.
In case of 2. ; you can check some examples of using CURL ( contrib/hbcurl ), or you
can build your own using SSL / TCP Harbour libs, I don't have an example of it.
I've already made small modifications to the original contrib/httpd which allows to
make some additional configurations like set supported methods from client, change
the original init/end tokens to pass values from Harbour to html templates ( AngularJS
uses {{ / }} as init/end token separators for html evaluation and pass additional info
to headers to allow CORS without additional tools o libraries.
It already has a example to serve as HTTP REST provider for the AngularJS quick start
tutorial at:
https://angular.io/guide/quickstart
this Harbour HTTP REST example is at:
https://github.com/tfonrouge/harbour-vszakats/blob/master/contrib/hbhttpd/examples/angularHeroesHTTP.prg
HTH,
best regards,
Teo
Hi Dave.
At this moment it is hard to give you some detailed answers. I hope this can help you at least to start working with REST.
To work with REST API I use Harbour ver. 3.2 with Curl, on Windows computers.
Find in this group messages on how to use Curl with POST or GET Http methods, to interact with resources on a server.
I guess you will use GET method to gather JSON data from vendors server.
Vendor must give your customer Url endpoint which defines how to get JSON data. Also vendor must give information concerning method of authorization, what data must be in request header, etc.
To use Harbour with Curl, you must have Harbour built with Curl and SSL. It can be tricky to do it from Harbour source because there are many variations on how to do it. On this forum there are many messages on that subject. Or may be you can somewhere find and download binary version of Harbour already built with Curl and SSL.
After your customer receives information from vendor, you can write test functions to send GET request to vendors server. In this forum you can find function examples, or you can ask question. You can also ask ChatGPT (I mean it seriously) in any phase of your work. It can give you useful example functions.
Response from GET request would be JSON data. You will need to process JSON data to make spreadsheet/CSV.
Instead Curl you can use XMLHTTP object (MSXML2.XMLHTTP or MSXML2.ServerXMLHTTP.6.0). I have started with Curl and did not used XMLHTTP object. Somebody think that it is even easier to use XMLHTTP object, but I did not used it. Here on forum there are also messages on how to use XMLHTTP object.
Try and ask. I am sure you will succeed.
Best Regards,
Simo.Why don't you try UT or HIX from Carles?
Regards
--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/f31a64e0-4d3a-4e4d-90b9-f3123d681460n%40googlegroups.com.