Problem with web-hop/redirect in http request
I have built a microcontroller, that collects various information from my house.
The build-in webserver returns this information in a JSON-string when requested via port 84. It all works nicely!
My website makes a http request to the microcontroller to get data and present it on a html page.
Yes – there is a cross-domain problem – but this has been solved and is outside this question. I have left this out of the code to simplify.
Now to my problem:
The code works without problem. As it can be seen from the url, I use port 84 on the microcontroller. I wanted to hide this, and created a web-hop on my DDNS (dyndns.com). This will redirect
'http://mycontroller.com:84' to 'http://mywebhob.dyndns.org'
I can test it by putting the two urls ( + '/fields.json') into my browser and in both cases, I get the json data back.
The two url’s are:
'http://mycontroller.com:84/fields.json' (same as in the code) and
If I change the value in the code of 'var myJson =' from the old url to the new url, the http-request return an ok response but no data????
The problem is caused by using a web-hop that redirects from a url with port to an url without a port – but why?????:mad:
Hoping for a smart answer (and maybe even a solution!):)
One thing (which is clearly not related to the problem but still wrong)
|All times are GMT +1. The time now is 08:46 PM.|
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.