Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create HTTP Request object
Message
 
 
To
24/12/2016 03:07:23
Thomas Ganss (Online)
Main Trend
Frankfurt, Germany
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
01645753
Message ID:
01646016
Views:
44
>>Here is my sample Json-formated string:
>>
>>
>>cJsonStr = [{"access_token":"OCu_7Rt","token_type":"bearer","expires_in":1209599,".issued":"Fri, 23 Dec 2016 21:58:29
>> GMT",".expires":"Fri, 06 Jan 2017 21:58:29 GMT"}]
>>
>
>I would worry about ".expires" and ".issued" as identifiers. Too lazy to look up if specific rules for JSON "key" naming exists, but starting with a period could create invalid property names if using eval() on JSON as some languages allow. OTOH: If you view the JSON just as a serialization of a hashmap, starting the hashmaps key with a period might not be forbidden, similar to vfp not allowing field names starting with a period, but a search field, which is indexed, can start with it.

I didn't create this JSON string; this string is returned by a 3P Web API. I was mistaken thinking that an object created from the JSON string has to be a collection. Antonio explained correctly that, in this case, it is a empty object with properties. And as long as I know what (the value of property "access_token") I am looking for, I can get it. Other properties of this object are not important to me in this case.
I will be now working on converting another JSON string into a VFP cursor and hopefully it will be more structured.
Thank you.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform