AnsweredAssumed Answered

PI Web API CORS stop me on some preflighted request.

Question asked by LucasERAS69 on Jun 27, 2018
Latest reply on Jun 28, 2018 by LucasERAS69

Hello,

 

I've been stumped by this issue for quite some time. When I click on a button, I wish to change the value of an attribute according to the value written by the user in a text field. To do that I execute a GET which fetch the selected attribute, then execute a POST which is supposed to change the value. The problem is, I get an error code 500 along with a message telling me I do not have the Access-Control-Allow-Origin header.

 

Here's my settings

Setting.png

And here's the script activated by my button

Code.png

 

I'm not sure what the red strip is.Anyway, I've also tried to put "plain/text" and "text" into contentType and dataType but to no avail. When the page load, I fetch all attributes of the element "Web test" with a serie of GET. I don't see why those work while my request here doesn't.

Outcomes