Re: [TypePad Developer Network.290] JSON Parser Problem

86 views
Skip to first unread message

Martin Atkins

unread,
Nov 29, 2011, 10:30:35 AM11/29/11
to typepad-d...@googlegroups.com
On 11/22/2011 07:09 AM, Cassio wrote:
> People, I'm trying to get my posts from my blog, but there is an error
> on the response of the JSON API.
> I'm checking it with a JSON Validator and the response is:
> Parse error on line 1:
>
> ^
> Expecting '{', '['
>
> This is occurring only with some posts (and of course, when I try to
> get all). I checked the entries and cannot find any "visible" errors.
>
> Can someone help me on this?
>

Hi Cassio,

Sorry for the delay in getting back to you.

My best guess for the above problem is that you got back a
non-successful response from the API. The TypePad API returns plaintext
errors and only returns JSON in the success case, so if you get back an
HTTP status code that starts with 4 or 5 then you shouldn't try to use
the JSON parser on the payload of that response but should instead just
take the HTTP status code and the whole response body together as the
error message.

Are you able to see the status code and raw body in your HTTP library?


Cassio

unread,
Nov 29, 2011, 10:32:21 AM11/29/11
to TypePad Developers Network
I got the solution. It was a problem with LATIN characters on
Categories. I just remove the categories and that's it. Tks.
Reply all
Reply to author
Forward
0 new messages