Using MicroSoft TouchDevelop as front end

Begonnen von amigob, 26 Dezember 2013, 14:29:57

Vorheriges Thema - Nächstes Thema

amigob

Hi all
I am trying to make a frond end with Touchdevelop from Microsoft
Creating button's is easy, but I have problems creating the json requests.

Does any body already have tried this ?
https://www.touchdevelop.com/docs/webrequests
https://www.touchdevelop.com/docs/parsingdata
with this url "http://192.168.146.132:8083/fhem?cmd=set%20test%20On"

tried the download, and the request, the fhem server doesn't do anything

Bart

rudolfkoenig

Did you try this URL in the browser?
Are you sure that On is correct? I'd try with on first.

amigob

yes, it is a dummy, so the status changes, when I do it via the browser.

Bart,

Rince

Wer zu meinen Posts eine Frage schreibt und auf eine Antwort wartet, ist hiermit herzlich eingeladen mich per PN darauf aufmerksam zu machen. (Bitte mit Link zum betreffenden Thread)

amigob

I send this command to a DUMMY

when you set 'On', status of a dummy becomes 'On'
when you set 'ON', status of a dummy becomes 'ON'
when you set 'dummy', status of a dummy becomes 'dummy'

And that is not happening via Touch develop that I tried, but it does do this via the brouwser.

Bart,

amigob

found the problem, and it can't be really fixed in a way that it is still safe.

The problem is that the request are send from the touchdevelop server, that means that
the request is done outside of my network. So the only way to get this working is to
map the 8083 port to my external IP address, that is something I will not do,
I only work local or via VPN.

So Conclusion, I will find a other way of implementing my app.

Bart

rudolfkoenig


amigob


  • reading the CORS p\rt of the link I posted

    ZitatWhen you perform a web request in the plain TouchDevelop Web App, the following will happen:

        The web request will be initiated from touchdevelop.com to the target domain
        If the target domain implements CORS, the result will be served to the script, and everything is good.
        If the target domain does not implement CORS, then the browser will refuse to deliver the response. TouchDevelop may be able to recognize this, and then it will try to route the request through a proxy service hosted by touchdevelop.com, which is exempt from the CORS rules.
        However, if the target domain resides on your local network, and is not accessible from the internet, then the proxy service will fail. To avoid this situation, your local network service would have implement CORS.