Richard Knop
Richard Knop

Reputation: 83677

How to deserialize JSON string

I have found lots of online tutorials but all of them are deserializing JSON strings into objects or lists of objects.

I just have a web service which returns either 1 or 0 as JSON.

So it prints something like:

""\"0\""

Or:

""\"1\""

How can I deserialize a simple JSON like that into a string?

Upvotes: 0

Views: 507

Answers (1)

ChaosPandion
ChaosPandion

Reputation: 78242

According to the RFC4627 a valid JSON string is defined as either a JSON object or a JSON array. Your web service should return something similar to this.

{ "Result": 0 }

Upvotes: 1

Related Questions