PC SOFT

FORUMS PROFESSIONNELS
WINDEVWEBDEV et WINDEV Mobile

Accueil → WEBDEV 23 → JSON to variant giving errors
JSON to variant giving errors
Débuté par Corné Hoeving, 25 sep. 2018 16:20 - Aucune réponse
Posté le 25 septembre 2018 - 16:20
Hello!

I'm trying to get information from a REST api using the following code:

PROCEDURE RequestREST(URL is string)

RDWRequest is restRequest
RDWRequest..URL = URL
RDWRequest..Method = httpGet
RDWRequest..ContentType = "application/json"

RDWResponse is restResponse = RESTSend(RDWRequest)

vRDWinfo is Variant
vRDWinfo = JSONToVariant(RDWResponse..Content)
//info(RDWResponse..Content)
Info(vRDWinfo.merk) <<<

Only, the bottom line marked with the "<" is giving me an error, saying that the vRDWinfo is not an object.
Is anyone able to point me towards a good solution?

Regards, Corné