Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing JSON to http Post?
Message
De
09/01/2017 05:18:21
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
01646398
Message ID:
01646407
Vues:
60
>
>cContent = "{ " + Chr(34) + "username" + Chr(34) + " : " + Chr(34) + this.cUser + Chr(34) + ", " + Chr(34) + "password" + Chr(34) + " : " + Chr(34) + this.cPasswort + Chr(34) + "}"
>
Those chr(34) would trip me up too often, so I'd code at least something like
cContent = "{ " + ["username"] + " : " + StreamStr( this.cUser ) + ", " +["password"] +  " : " + StreamStr( this.cPasswort ) + "}"
Even better is a small library with functions/methods like JSONValue(key, value), JSONStr(Key,value) and so on -
but the relatively slow function calling of vfp compared to statically typed langs or even partially JITted dynamic ones makes that
questionable for sites with taxed CPU load if coded with no breaking of DRY coding ;-)
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform