There are a few other recent posts regarding this issue (ie, http://developer.appcelerator.com/question/80551/json-http-requests-always-log-message-about-parsing-error) but none seem to be addressed/solved/confirmed. I'd like to know if this is a known bug or a problem with my code…
I am using the HTTPClient to fetch and parse JSON. This works just fine, however the following info message gets logged to the console:
Entity: line 1: parser error : Start tag expected, '<' not found
I am using JSON.parse(this.responseText) inside the xhr.onload() method.
Also, the following error gets logged to the console:
[ERROR] Error Domain=com.google.GDataXML Code=-1 "The operation couldn’t be completed. (com.google.GDataXML error -1.)". in -[TiDOMDocumentProxy parseString:] (TiDOMDocumentProxy.m:50)
I tried setting the request header as follows but it does not resolve the issue:
Again, the JSON is being parsed correctly and everything is working fine, it's just that I get a bunch of extraneous info and error messages logged to the console. Has anyone solved this? Or is this a known bug with the recent 1.5 nightly build?
I have this issue as well. I've tried the following to no avail:
- set the request header in the app.
- confirmed that the content_type is correctly set as "application/json" for the document on the server.
- set the document extension to .json on the server.
- commented out everything in client.onload (which contains JSON.parse(this.responseText)).
- changed the encoding on the document itself (for example, from utf-8 to Western (Windows Latin 1)).
- saved the document as ASCII text using a different text editor.
So I would think this is a bug with the recent 1.5.0 nightly builds. The issue is that, as soon as it's loaded, the document is being parsed as xml (since the error occurs even when JSON.parse is commented out).
I can confirm that the Twitter demo in Kitchen Sink also has this issue.
I know this doesn't really help, but hopefully sheds some more light on the problem.