Thanks for getting back to me, in the past I got around the cross domain issue by enabling cors in the project and this works perfect for 'POST' method.
I just thought there may have been a simple solution in umbraco that you can enable this to work.
The error I'm getting back in my browser is 'Response for preflight has invalid HTTP status code 405' when I try and hit the method. When you research this error, the solution seem to be enabling CORS. I tried install CORS, however it broke my solution because of the changes to the web.config file.
Like I said in the first post though, the 'GET' works perfectly.
I may have to add a web api project to my solution and reference the umbraco solution to access the methods I need.
Umbraco Web API - Cross Domain Problem
Hi,
I have a Umbraco 7 solution which is used to collect and send data using the 'UmbracoApiController' and works fine.
I can use 'GET', and 'POST' to access my methods via jquery ajax on the same domain.
However my problem arises when I try to access the API methods from a different domain (only with the 'POST' though, 'GET' works fine).
If I had an mvc web api project, I could fix this problem by installing CORS through NuGet.
My question is, how do I get around this problem with Umbraco 7? I want to be able to use the 'POST' method.
Thanks
Darren
Hi Darren,
It's not Umbraco problem, making cross domain ajax POST request is the common problem.
The best way to create some proxy on your server, and make requests via proxy method.
Cheers
Hi Alex,
Thanks for getting back to me, in the past I got around the cross domain issue by enabling cors in the project and this works perfect for 'POST' method.
I just thought there may have been a simple solution in umbraco that you can enable this to work.
The error I'm getting back in my browser is 'Response for preflight has invalid HTTP status code 405' when I try and hit the method. When you research this error, the solution seem to be enabling CORS. I tried install CORS, however it broke my solution because of the changes to the web.config file.
Like I said in the first post though, the 'GET' works perfectly.
I may have to add a web api project to my solution and reference the umbraco solution to access the methods I need.
Thanks again Alex for getting back to me.
Darren
is working on a reply...