HTTP call from evothings client

Discuss the company and its products.
JimB
Posts: 8
Joined: 09:46, 26 Nov 2015

Re: HTTP call from evothings client

Postby JimB » 19:00, 27 Nov 2015

I have followed that, but must be missing something. But it appears not to be an Evothings problem, so there's that.

JimB
Posts: 8
Joined: 09:46, 26 Nov 2015

Re: HTTP call from evothings client

Postby JimB » 09:12, 29 Nov 2015

The CORS stuff is now working (<AllowedHeader>Content-*</AllowedHeader> was the missing line, apparently) and my Evothings app can access the JSON file in terms of linking to it and displaying it, but it isn't reading it in the code. Working on it.

And running the HTTPGET Cordova I get
LOG: {"status":500,"error":"There was an error with the request"}

JimB
Posts: 8
Joined: 09:46, 26 Nov 2015

Re: HTTP call from evothings client

Postby JimB » 09:58, 29 Nov 2015

And FYI
$(document).ready(function() {

//after button is clicked we download the data
$('.button').click(function(){
$.getJSON("http://giveandgo.nz.s3-website-ap-southeast-2.amazonaws.com/location.json", function(result){
$.each(result.locationlist.location, function(i, field){
//alert(field.name );
$('#results select').append('<option value=' + field.locationID + '>' + field.name + '</option>');
});
});
//start ajax request
});
});

Works on a webpage but not Evothings.

alex
Posts: 92
Joined: 00:59, 19 Nov 2013

Re: HTTP call from evothings client

Postby alex » 20:39, 21 Dec 2015

Hi!

I think it's a matter of mixing protocols. Your page is served to the Viewer by https from the server, while the resource you're picking up is http in the JSON call. That would result in a protocol violation. You could try using https://giveandgo.nz.s3-website-ap-sout ... ation.json
instead, given that the site has a valid certificate.

best

Alex

JimB
Posts: 8
Joined: 09:46, 26 Nov 2015

Re: HTTP call from evothings client

Postby JimB » 04:25, 28 Dec 2015

Got it going by using the AWS API Gateway. All running lovely now. Thanks for the support!

gokr
Posts: 13
Joined: 12:50, 02 Nov 2015

Re: HTTP call from evothings client

Postby gokr » 10:00, 28 Dec 2015

Great to hear you got it working!

We are about to post much more about the intricacies around CORS and http vs https - as mentioned here the app is served from our cloud over https so you can not access any http resources from the app - you must use https (with valid certs!) and if you use web sockets you must also use secure websockets (again with valid real certs). This can be a bit of a hassle when developing.

The latest viewer that we are in the process of publishing will also have the ability to do http requests via a Cordoba plugin (thus sidestepping this issue) but that of course needs to be done with specific code.

regards, Göran

PS. We are on http://gitter.im/evothings/evothings also, and we try to always be available for questions!


Return to “General discussion”

Who is online

Users browsing this forum: No registered users and 4 guests