CORS : Cross Origin Resource Sharing Asp Net Web API Manage web api cors issue

CORS : Cross Origin Resource Sharing Asp Net Web API Manage web api cors issue

TechChips

54 года назад

121 Просмотров

How can we overcome the CORS issue for ASP Net Web API

Add the cores package to you project

Install-Package Microsoft.AspNet.WebApi.Cors

Then add this setting in webapiconfig.cs class
config.EnableCors();

Add attribute to api controller or on it methods.

[EnableCors(origins: "http://abc.net", headers: "*", methods: "*")]
public class MyController : ApiController
{
}

More videos here...

What are new features of ASP.Net MVC 6
https://www.youtube.com/watch?v=jvKQhN13yUc

What is ASP.Net MVC 6 ?
https://www.youtube.com/watch?v=x7ZhS_DaQDI

What is Json?
https://www.youtube.com/watch?v=eg862N_RIX8&t=2s

What is a restfull service ?
https://www.youtube.com/watch?v=MJmkocADx-Q&t=1s

What is ASP.Net Web API
https://www.youtube.com/watch?v=Slf2uWKwhKc&t=5s

Latest in ASP.Net MVC 6
https://www.youtube.com/watch?v=yVvTJbWmjig&t=8s

ASP.Net Web API Tutorial 90% OFF
https://www.youtube.com/watch?v=W9WGPfmfoU4&t=11s

ASP.Net Web API CRUD OPERATIONS
https://www.youtube.com/watch?v=UkN45YDyuSA&t=29s

ASP.NET Web API OdataQuery Options Usage
https://www.youtube.com/watch?v=3cdyDeKnK8Y

Hosting ASP.Net Web API in IIS and IIS Express.
https://www.youtube.com/watch?v=HwwvNft38Us&t=135s

Self Hosting ASP.Net Web API
https://www.youtube.com/watch?v=5oPDK3lM8Do&t=15s

Exeption Handling in ASP.Net Web API
https://www.youtube.com/watch?v=T4uPtBtKEAM

ASP.Net Web API and Bson format
https://www.youtube.com/watch?v=i7D27VnT3aw

ASP.Net Web API XML and Json formats
https://www.youtube.com/watch?v=nGSWrDj-zp0&t=15s

ASP.Net Web API Media formatters
https://www.youtube.com/watch?v=0y7vqZiMXEY

ASP.Net Web API Routing
https://www.youtube.com/watch?v=-daJq7FPkzs&t=425s

ASP.Net Web API and Entity Framework
https://www.youtube.com/watch?v=zAH1ApHEqXo

Unit Testing ASP Net Web API controller
https://www.youtube.com/watch?v=FsB0ZeSv-Uo&t=100s

#EnableCorsinWebApi
#CorsIssueWebApi
#WebApiAndCors

Тэги:

#Asp.Net #WEB_API #CORS #CORS_Issue #CORS_and_Web_API #.Net_Core #MCV_6 #ASP.NET_MVC #visualstudio_2015 #javascript #c# #rest #ASP.Net #Cross_Origin_Resource_Sharing #enable_cors_web_api #enable_cors_api_C# #asp.net_web_api_cors #visual_studio #disable_cors_web_api #web_api_2_cors_example #web_api_install_cors #cross_domain_ajax_request_web_api #jsonp #what_is_jsonp #access_control_allow_origin
Ссылки и html тэги не поддерживаются


Комментарии: