Quantcast
Channel: Configuration & Scripting
Viewing all articles
Browse latest Browse all 780

Failed to load resource: the server responded with a status of 405 (Method Not Allowed)

$
0
0

Good Evening all

i am trying to post data coming from a form to the server and return a string , when i test this service works nicely. Its a Rest web api. now iam consuming it in Javascript Ajax like this

<script type="text/javascript">
function ProcessRegistration() {
jQuery.support.cors = true;$.getJSON("http://www.mydomain.mymaindomain.com/api/Registration/Create", function (data) { 
alert(data);

}); 
} </script> 



When i run this and i get an Error

 
Failed to load resource: the server responded with a status of 405 (Method Not Allowed)http://www.mydomain.mymaindomain.com/api/Registration/Create 
 

i have added the headers in IIS

 "Access-Control-Allow-Origin" "*" 

in my web config of the service i have added

 

<system.webServer><httpProtocol><customHeaders><add name="Access-Control-Allow-Origin" value="*" /></customHeaders></httpProtocol><........... 

i have done all suggested by my research but i still get that error, try to restart the server but still the same.


Viewing all articles
Browse latest Browse all 780

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>