G Web Development Software

cancel
Showing results for 
Search instead for 
Did you mean: 

G Web error message No 'Access-Control-Allow-Origin' header is present

Hello!

 

I'm trying to do an HTTP POST request with LabVIEW NXG 5.1.0

 

If I run the code from a .gvi code works ok.

jesushidalgo_1-1661037395876.png

jesushidalgo_2-1661039422382.png

 

but when I run it from a .gviweb code, it returns the following response:

 

"JavaScript message: Failed to load https://console-vip.helium.com/api/v1/down/...: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost' is therefore not allowed access. The response had HTTP status code 404. in main.html at line 0"

jesushidalgo_0-1661039891275.png

 

When I remove the HTTP Handler and the ADD header nodes, I got a successful 200 code from the HTTP POST request, but the server API drop the request with the following message:

 

"description": "Failed to queue downlink (downlink_decode failed): payload_raw_not_found",

jesushidalgo_1-1661041353690.png

jesushidalgo_2-1661041375651.png

 

 

I will appreciate suggestions!

 

Best regards.

 

Msc. Jesus Hidalgo
CLA, and NI Certified Professional Instructor
Discipline, pasion for excelence...
0 Kudos
Message 1 of 2
(1,964 Views)

Hey!

 

I had a similar issue lately but with G Web so I'm not sure if this will work with NXG and the Web Module (even though G Web is the web module based on NXG).

 

In G Web there is an extra VI to configure CORS and to include credentials with a request if needed maybe this might help.

Snippet.png

0 Kudos
Message 2 of 2
(1,919 Views)