Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

REST service error

I created a REST service to get the ESV Bible API (esvapi.org) daily verse, and put it into an HTML component.

The service tests fine, and the URL it produces work fine. However, when I test it in the app, I get this:
precodeXMLHttpRequest cannot load http://www.esvapi.org/v2/rest/dailyVerse?&key=[MYKEY]&include-headings=false&include-footnotes=false&include-audio-link=false. Origin http://appery.io is not allowed by Access-Control-Allow-Origin. /code/pre

Any thoughts?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

REST service error

Hello! Could you post service settings screenshot?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

REST service error

Here it is, including the test.
Image

Image

Image

Image

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

REST service error

Hello Doug,

On "dailyESV"-settings tab-tick "Use Appery.io Proxy".
"Test" the service-click " Automatically Create Service Response" and remap elements on service screen.

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

REST service error

I created the response and mapped it. It's still not showing anything. The service isn't returning an error now; it's just not showing anything.

Is it because the service returns HTML instead of a JSON response?

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

REST service error

Though now that I look in the console, the header is sent as:
Request URL: https://appery.io/app/rest/tunnel?key... KEY]&include-headings=false&include-footnotes=false&include-audio-link=false

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

REST service error

Hi Doug,

A service can return json,sjonp,xml, but not html. If you specify data type as xml and will process html then you get a data structure, but not an html page.

Doug Black
Posts: 0
Joined: Wed Aug 14, 2013 11:36 am

REST service error

Thank you for clarifying. I was able to get it into XML, and it should work now.

For anyone else's reference, for esvapi.org: use output-format: crossway-xml-1.0

Return to “Issues”