AnsweredAssumed Answered

Problem with CORS - method 'GET' is not allowed

Question asked by FranzK on May 10, 2017
Latest reply on May 10, 2017 by FranzK

I wanted to follow the excample about cors.

 

my code is as follows:

code.JPG

 

I removed the encoded username password.

 

My WEBAPI Settings are as follows:

WebAPIconfig.JPG

Authentication is Basic:

 

auth.JPG

 

When i try debugging, i get the HTTP status 400:

HTTP400.JPG

 

Debugging Network Header Information:

Headers.JPG

 

with this information i could not find any wrong configuration of my CORS Settings, but maybe i miss something

In the Response debuging information i get the message 'GET' is not allowed:

notAllowed.JPG

when i copy the  request URL from debugging and copy it in the browser adress field, i get an Authenticaton Required:

authrequ.JPG

 

After entering my credentials it works in the browser, so i think my ajax URL is OK:

 

browser_works.JPG

 

where is my problem? is it a wrong cors setting or an error in the code?

 

best regards

Franz

Outcomes