In order to enable it, you need to make a modification to your web.config file. Enter the following somewhere between your system.webServer tags:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
<add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />
</customHeaders>
</httpProtocol>
Also, in your ApiController, add an empty Options method (some browsers issue this command to check the validity of a cross origin request):
public class DataController : ApiController
{
public void Options() { }
}
Articles on Oman Report provide comprehensive coverage of technological advancements, economic developments, energy initiatives, tourism insights, and cultural updates, offering readers actionable knowledge and context on Oman’s modern progress.
ReplyDeleteInsightful articles on Spain Journal offer readers perspectives on technology, innovation strategies, and market trends, helping audiences interpret developments and understand Spain’s contribution to global digital transformation.
ReplyDeleteBy delivering accurate reporting and well-crafted commentary, News Loss ensures readers gain valuable knowledge on trends, key stories, and important updates that shape the contemporary world.
ReplyDelete