Closed biapar closed 7 years ago
Hi, the problem is server side. How solve?
Sounds like you need to enable CORS, take a look here https://docs.microsoft.com/en-us/aspnet/web-api/overview/security/enabling-cross-origin-requests-in-web-api#enable-cors
Ultimately, you should be able to call this in an application starting event handler:
GlobalConfiguration.Configuration.EnableCors();
And then on your API controller, you'll need to add the endable CORS attribute:
[EnableCors("*", "*", "*")]
You'll need to make sure the params match your configuration though. See the link for details on what those params are.
Hi,
if you call a method like your example, we receive the error "The requested resource does not support http method OPTIONS". Why?
`[Our.Umbraco.AuthU.Web.WebApi.OAuth("realmusers")] public class LGIWFPraticheController : UmbracoApiController {
called by: ` var token = localStorage.getItem("token");
return this.http.get('http://localhost:60936/umbraco/api/LGIWFPratiche/helloworld', options) .map(this.handleData) .catch(this.handleError);`