Welcome! Log In Create A New Profile

Advanced

[WD23] - Consuming JSON

Posted by JP 
JP
[WD23] - Consuming JSON
July 31, 2018 02:18PM
Hi All

I can get a JSON feed of data from a supplier. They can also provide it in other formats but the JSON is ready to go now. Is WinDev a good tool for reading and processing a JSON feed?

Thanks
Fabrice Harari
Re: [WD23] - Consuming JSON
July 31, 2018 02:43PM
Hi JP

sure... just look in the help at json and search for json on this forum for examples

Just be aware that json functions are not at the same level in all environments (or were not, the last time I checked), so depending on which version and which tool, your milage may vary.

Best regards
wduser
Re: [WD23] - Consuming JSON
August 01, 2018 10:22PM
Hi ,

Depends on the json format. If it is not what windev or webdev expects then it is a pain in you back-end .

webdev has cool features for using third party controls etc. But for instance you cannot use controls from syncfusion. Because syncfusion doesnot recognize the webdev json. The json string starts with a space and that is funest.

It is a pitty for if it would work then wow we had a webdev with more controls then windev.
So try and if it works ok . IF not then maybe sent pcsoft a support mail.

R
JP
Re: [WD23] - Consuming JSON
August 02, 2018 08:45AM
Thanks Fabrice and wduser. Will check it out !
steve erts
Re: [WD23] - Consuming JSON
August 02, 2018 11:41PM
One I got the hang of it I've had great luck working with JSON in windev both creating and consuming. Way easier than XML IMO

JSONToVariant and VariantToJSON are a great place to start.



Edited 1 time(s). Last edit at 08/02/2018 11:41PM by steve erts.
Re: [WD23] - Consuming JSON
April 03, 2019 02:11PM
steve erts Wrote:
-------------------------------------------------------
> One I got the hang of it I've had great luck
> working with JSON in windev both creating and
> consuming. Way easier than XML IMO
>
> JSONToVariant and VariantToJSON are a great
> t place to start.


Hello,

Thanks a lot. Your comments got me started on JSON in a very easy way. I cannot believe it is this easy to use JSON.
Re: [WD23] - Consuming JSON
April 04, 2019 08:22AM
But I have one problem.

How to send JSON to remote service?

--
Yogi Yang
Re: [WD23] - Consuming JSON
April 04, 2019 08:53AM
Hello,

Solved the problem by using following code:
req is httpRequest

req..URL = sURL
req..Method = httpPost
req..ContentType = "application/json"
req..Content = VariantToJSON(JZ)

HTTPresponse is httpResponse = HTTPSend(req)

TIA

--
Yogi Yang
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: