HTTP call from evothings client
Re: HTTP call from evothings client
I have followed that, but must be missing something. But it appears not to be an Evothings problem, so there's that.
Re: HTTP call from evothings client
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"}
And running the HTTPGET Cordova I get
LOG: {"status":500,"error":"There was an error with the request"}
Re: HTTP call from evothings client
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.
$(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.
Re: HTTP call from evothings client
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
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
Re: HTTP call from evothings client
Got it going by using the AWS API Gateway. All running lovely now. Thanks for the support!
Re: HTTP call from evothings client
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!
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