Trying this on a single Windows 10 machine
Am trying to understant URLConnection. In doing so I am creating two apps, one to request the data and one to receive. The eddies electronics uses this code
EEConnector.Send("GET", "https://demos.xojo.com/EEWS/index.cgi/api/GetAllCustomers") which includes a path as part of the URL. When doing debug on a single computer, what would that path be? My initial thoughts are 127.0.0.1 but that did not work. Do I need to include the “DebugMy Application” as part of the path? I thought not, but not really sure.
I tried two ways, both using the same Windows machine
EEConnector.Send("GET", "http://" + ControllerIP + "\\E:\\Axcys Embedded_Linux\\Axcys Web Services\\Axcys Server\\DebugMy Application\\getAllUnits")
EEConnector.Send("GET", "http://" + ControllerIP + "/E:\\Axcys Embedded_Linux/Axcys Web Services/Axcys Server/DebugMy Application/getAllUnits")
The first gave a bad error that caused a crash (no error handling built in yet). The other errored properly saying that the URL is likely bad.
So for development what is the correct path? And in practice, I do I also need the path that the app is placed in?
The path depends largely on the configuration of your local http server, but it certainly wont have the drive letter in it.
The IP address probably is 127.0.0.1, but the rest of the xojo cloud path is particular to how it delivers pages.
Are you using a local web server or are you running your web app directly in the xojo ide?
At this point, I am running from within the IDE. However the next step would be to run on a raspberry pi and/or windows machine.
The “path” is the URL to the web app. if you’re running it locally on the same machine then you’ll see the URL in the address bar. By default it is:
You’d then need to add any additions to the path as needed for the web service. So if you were running EEWS locally you could use:
If you’re running it on the Raspberry Pi, then you’d use it’s address. The Pi on my local network is 10.0.1.3 so I would use this:
I tried pushing it to the folder where the debug build is done but that did not work.
Just found out that the /api/ although not a real folder is required as part of the path. I did not know that! I was missing both the port and the /api/ in each of my path tests.
Thanks for the help!