vendredi 23 juillet 2021

How to enable CORS in vb.net web api project

Environment: Microsoft Visual Studio 2019 Community, ASP.NET v4.8 web application/web api project using VB.NET

I can find lots of C# answers to this but no vb.net answers. I have added the CORS Nuget packages to my project and added <EnableCors("https://ift.tt/3eNXvOK", "", "")> to the POST section of my api controlller. It compiles and runs but makes no difference ie any origin domain can still call the POST method.

I think I need to enable CORS to the application configuration somehow - possibly in webapiconfig/register? What is the syntax for doing this?




Aucun commentaire:

Enregistrer un commentaire