Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Ojong Obasi
6,561 PointsI am trying to build a JSON api like the one used in the Android Blog reader app
I am trying to build a JSON api like the one used in the Android Blog reader app. I am using php and I have a page that gives me the following results :
```{ status: "ok", count: 20, count_total: 400, pages: 400, posts: [ { id: "121", url: "http://www.website.com/file/122/daytime", title: "day", author: "time", date: "2014-09-22 01:35:56" }, { id: "122", url: "http://www.website.com/file/122/daytime", title: "Dance Floor", author: "2face Idibia", date: "2014-09-22 01:55:08" } ] }
Here is the url of my api ```http://www.website.com/jsonapi.php```
Now when I change the url of the blog app and put the above, it gives me this exception:
```org.json.JSONException: Unterminated string at character 218 of {"status":"ok","count":20,"count_total":400,"pages":400,"posts":[{"id":"121","url":"http:\/\/www.website.com\/file\/121\/daytime","title":"Day time","author":"day Time","date":"2014-09-22```
1 Answer
Eduardo Velasquez
15,697 PointsYou're missing a "}]} to close your JSON data