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

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -