json - A JSONObject text must begin with '{' at character 0 -
i trying parse json can different parts of json. when use following code
jsonobject jsonoutput = new jsonobject( aresponse.getentity(string.class) );
i'm getting error :
org.json.jsonexception: jsonobject text must begin '{' @ character 0
aresponse.getentity(string.class)
returns json below....
{ "list": { "access_level": "readonly", "address": "995@mg.lmsnet.com", "created_at": "tue, 19 apr 2016 04:01:05 -0000", "description": "", "members_count": 0, "name": "995" }, "message": "mailing list has been created" }
any ideas why i'm getting error? able validate json on line json validator
turns out had string variable , error went away.
string tempstr; clientresponse aresponse = createmailinglist( "9967" ); **tempstr = aresponse.getentity( string.class);** jsonobject jsonoutput = new jsonobject( tempstr ); system.out.println( jsonoutput );
Comments
Post a Comment