Canvas - Unable to send API Post

Hello,
I’m trying to send API posts to node-red but it’s not working.
Here’s a screenshot of the console.

image

Node-red is hosted on the same machine, so instinctively I put “localhost” (but I also tried with 127.0.0.1 and 192.168.1.XX).
In the node-red configuration file, I’ve enabled this option:

httpNodeCors: {
    origin: "*",
    methods: "GET,PUT,POST,DELETE"
},

But all this doesn’t work.

Is there a parameter to modify in the grafana.ini file, and if so, which one?

Thanks in advance for your help.

Probably need to provide a bit more detail than just doesn’t work?

Any errors?

Thanks for your answer !

It’s on the screens shot.

But, I found a first solution.
It doesn’t work with localhost:1880 but with ip 192.168… it does.

Hi Ayno! The reason why the request wasn’t working is due to a security check that ensures that API requests are not possible to Grafana itself which is checked here in the code.

This check is implemented by checking the request’s origin and comparing that to Grafana’s origin, which is why localhost in this case doesn’t work but providing node-red’s IP address does work :slight_smile: