CORS Error with PI Web API POST Request

Hi, I’m making a POST request to the PI Web API, but I always encounter a CORS error. The server is configured properly. Here’s the error message and screenshot of what I’m doing.



Text error: Access to fetch at ‘url endpoint’ from origin ‘url’ has been blocked by CORS policy: Response to preflight request doesn’t pass access control check: No ‘Access-Control-Allow-Origin’ header is present on the requested resource. If an opaque response serves your needs, set the request’s mode to ‘no-cors’ to fetch the resource with CORS disabled.
What could be the issue, and how can I resolve it?

What domain is your grafana in and what domain is your web api?

How can this information help? I’m not sure if I can share it because the system is not for public use

1 Like

Understood. but the fact that you asked “how can this information help” is a bit worrisome. Anyways read up what CORS is in general and how it relates to your particular predicament. one domain is not trusting the other, which is not a grafana issue, you need to configure things so they trust each other.

check this issue below.