Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofJson from string / ofxJSONRPC results

$
0
0

@fresla wrote:

I am using ofxJsonRPC and have a question. I get my response from clients (based on the example through this line of code:

ofLogVerbose("ofApp::setText") << args.params.dump(4);

It dumps the JSON file as a string. However it contains / that I guess are used to escape the " but it is a string.

so I get this:

{\"userid\":\"+123456789\",\"question\":3,\"answer\":\"B\"}

instead of:

{"userid":"+123456789","question":3,"answer":"B"}

If I try to parse args.params, or args.results I don’t get any data, however the string dump shows I have the data coming back.

How can I either convert a string, already correctly formatted like this:

{"userid":"+123456789","question":3,"answer":"B"}

to ofJson,?

Or better yet how can I parse the data that returns from ofxJSONRPC with ofJson?

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles