Cross-Origin Request / CORS header - Robot Web Services
Humphrey
✭
I'm trying to run the example javascript client for the Robot Web Services REST API as found in the documentation:
I have changed the URL to the IP address of the controller:
rwServiceResource.open("GET","http://192.168.125.1/rw/system?json=1",true);<br>When opening the html file (from my laptop on my laptop, for development) I am getting an error in the javascript console
:
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://192.168.125.1/rw/system?json=1. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).
How should I fix this? Why doesn't the controller API give a CORS header? I can't serve the html from the controller right?
Tagged:
0
Comments
-
Oh, after posting I noticed some information in the documentation that I didn't see earlier because of some strange behaviour of the documentation site.
It states:- Create a folder named docs under the HOME folder on the controller.
- Copy the html file to the HOME/docs folder
- Enter the URL {controller ipaddr}/docs/HelloControllerHtml.html in a web browser. (Depending on your network; you migth need to disable the proxy in your web browser)
- For a VC type the URL http://127.0.0.1/docs/HelloControllerHtml.html in the browser
So my new question is: is there some way to serve the code outside of the controller?
0
Categories
- All Categories
- 5.5K RobotStudio
- 396 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 250 ScreenMaker
- 2.8K Robot Controller
- 316 IRC5
- 61 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 798 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 5 Job listings