12-07-2024 10:17 AM
Hi,
I trie to develop a webserver to visualize and send command at a raspberry pi4.
My VI run on the raspberry, and with the Webservice and G-Web, I can display on a web site many values.
But when I want to send a new value with the web site to the raspberry, with the PUT method:
- with the command in a web browser "http://192.168.1.168:8001/WebService1/PUT_VALUE?GUIValue=10"
I have the error "Access Error: 404 -- Not Found"
- with G-Web Developpment software, with "PUT buffer.vi" in a diagram, I have the error below
"Javascript message: Failed to load http://192.168.1.168:8001/WebService/PUT_VALUE: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' Header is present on the request ressource.
Origin 'http://hpi7-ob:8001' is therefore not allowed access. The response had HTTP Status code 404."
Any idea about my error? How pass the"access control check"?
I tried different setup of CORS, but still stuck.
Thanks,
12-07-2024 02:18 PM
You haven't said what actual CORS handling you've tried so we won't know what's different/wrong to try something else.
12-08-2024 03:06 AM
Thanks to have take time to answer.
In Gweb I allow remote connections from any client, and I have enabled CORS for all origins, like screen capture below.
For information, I use apache2 web serveur on raspberry.
12-09-2024 09:48 AM
That's for the g web app, how are you deploying the web service? Likely need to set the cors headers on the requests being handled by the LabVIEW web service.