This question is actually very early consideration, because there is no particular urgency to solve the problem, has been dragged ....
Well, procrastination is not good, all do not bother to do, will eventually force you to a short time to solve the problem ... Implementing the Project
Rewrite an existing WebForm project, need mobile phone and web side data to maintain interoperability, so the first reaction is ABP, can learn, can also complete the task
In the attempt to invoke the API at the time of the Cors cross-domain request problem, before very confused practice cors is not know what, this time also know. Solve the problem and read the document with questions
Http://aspnetboilerplate.com/Pages/Documents/Zero/Startup-Template Abpzero's startup template says how to invoke the API
It's still stuck in cors.
Search for issues in the ABP GitHub search for Cors found
Web API Project:
Install-Package Microsoft.AspNet.WebApi.Cors
Web API Project Module Initialize () Add:
var cors = new EnableCorsAttribute("*", "*", "*");GlobalConfiguration.Configuration.EnableCors(cors);
方法,解决问题,花费了很长的时间,答案往往是简单的要命....
哦对了,有个问题一定要注意
Just made a POST request to http://localhost:6334/api/services/app/tenant/GetTenants with Content-Type="application/json" and Authorization="Bearer your- auth-token ". Request body was just empty {}. Surely, request and response body will be different for different APIs. 在headers里写Authorization的时候一定要是
"Bearer your- auth-token"
Cors for ABP phone-side Invoke API