webapi cross domain (MVC-Web API: 405 method not allowed issue)

use webapi cors

1. Installation package: Install-Package Microsoft.AspNet.WebApi.Cors –IncludePrerelease

2. Add the following code to webapiconfig.cs.

var cors = new EnableCorsAttribute("*", "*", "*");
            config.EnableCors(cors);

  

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324835943&siteId=291194637