Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

I've got an app that I'm testing a jsonp request to a Wordpress page using the JSON API Plugin:
http://wordpress.org/plugins/json-api/

For some reason, the panel is not displaying the content that I can see in the Response section of the service I've created.

What's even weirder is that I had this working using the appery.io tester (android) earlier today. It worked like a charm first try! Then I get home and realize that it's not working anymore--nothing changed.

At the time, I just had a simple "GET" with 'json' and not using jsonp. I've gone through a ton of different selections to recreate the successful attempt that I had earlier in the day, and have had no such luck.

I've shared the test app (called 'browserview') with a href="mailto:support@appery.io" rel="nofollow"support@appery.io/a ...please help with this, as it is the only thing preventing me from final build. The actual implementation will go into another project that I have on here, but in order to simplify things, I've reduced it to the browserview app.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Panel not displaying response data from service

Hello,

Please take a look at our tutorial how to use mapping service
http://docs.appery.io/documentation/u...

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

Did you look at the project? I had this mapping working earlier today and then tonight, it was not working. Also, when I run the Chrome Developer Tools window when running a Mobile Preview, the GET method is returning a "200 OK" Status text. Additionally, I can click on the method specifically and see the intended response/preview. For some reason, either the service is not invoking or it just doesn't like what I'm giving it. I just don't understand why it would have worked earlier today and not now.

Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

Panel not displaying response data from service

Yes I did. Sorry for misunderstanding. It seems that service returns not valid JSON.
You can use http://jsonlint.com/ to check JSON.

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

I'm not really understanding the error. It is saying that saying that is expecting a string, but the "content" section is within a string....

"content" : "htmlcodehere",

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

Update: When I test the "URL" of the page in JSONLint, I get a successfull return; however, when I run a Test on the service within appery.io and then copy/paste the results from that window into JSONLint, I get the parse error.

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

I think I just found the error. It appears that the "Response" in Appery.io is adding carriage returns to the data via a word wrap. When I put in the URL, the content I get is all on one line, and I get no parse error. The error occurs at 248 characters, at which point the line goes down to the next row.

I'll try storing the response data in a local variable and see how that goes.

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

The issue is caused by unnecessary line breaks being added in the response. If you remove the unnecessary line breaks, you can get a valid JSON response.

Is there any way to prevent the Appery.io response textfield from adding line breaks to the response window?

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

Here is the problem from the response. Notice the spaces after 'Open Sans', ...I am assuming this is a "tab" or "line break" of some type. Here is the response data:

Image

I removed some of the code for discretion purposes, as it is not relative to what I'm trying to illustrate here. Would there be a way to fix the huge gaps before sans-serif in the above content or add possibly a header to ignore that whitespace?

Jeff Givens
Posts: 0
Joined: Sat Aug 10, 2013 8:20 pm

Panel not displaying response data from service

Any thoughts? Really hoping to get this done tonight.

Return to “Issues”