Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Passing JSON to http Post?
Message
From
09/01/2017 05:18:21
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01646398
Message ID:
01646407
Views:
59
>
>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 ;-)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform