To decode API response string to JSON, json.decode() works fine. This will parse a JSON string similar to
{ “Response” : {“Responsecode” : “1” , “Response” : “Success”}}
But in my case, the response is in the form :
“{\”Response\” : {\”Responsecode\” : \”0\” , \”Response\” : \”Success\”}}”
json.decode() won’t work. I searched but couldn’t find how to unescape characters in a string. Please help
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/45641080-337b-4a3b-8c8b-20512363fd3c%40dartlang.org.
For example,
{\"key\": \"abc\"de\"}, removing slashes will result in {"key": "abc"de"}, which will create problem while json parsing.
But the result should be {"key": "abc\"de"}, which clearly shows that the value of key is abc"de
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CAGpBjM%2B3CfbS-fMogNys5ppbPfZdAXja2AW79o6mHYEeOOoeGA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/CACshfx1-oUpLq51h7yof5rWNEU7WMezjsDjkKba6STTqrp%2BH1Q%40mail.gmail.com.
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/4d7bacd1-3364-4c14-8b1c-ce05170dcdb6%40dartlang.org.
How can I convert this json array to list of a class (say Class Response having string variables as Responsecode and Response)?Does dart has something similar to java's gson?
--
For more ways to connect visit https://www.dartlang.org/community
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+uns...@dartlang.org.
To view this discussion on the web visit https://groups.google.com/a/dartlang.org/d/msgid/misc/e1a0600c-76c1-4ad1-9f33-f885a8098625%40dartlang.org.