1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
//Je déclare ma structure
STProduit is Structure
Id is int sur 8
name is string
FIN
tabMaListeProduit est tableau de STProduit
//stMonProduit est STProduit
UrlAPI is string = "https://xxxxx.com/api/products?output_format=JSON"
RstRequete.URL = UrlAPI
RstRequete..Méthode = httpGet
RstRequete.MotDePasse = "pass
RstRequete.Utilisateur = "macle"
//RstRequete.ContentType = "application/json"
RstReponse = RESTEnvoie(RstRequete)
Désérialise(tabMaListeProduit,RstReponse..Contenu,psdJSON) // Ici m'affiche le message : L'élément JSON n'est pas un tableau.
POUR TOUT stMonProduit DE tabMaListeProduit
Trace(stMonProduit.Id,stMonProduit.name)
FIN |