ASP.Net 4 API Route API without MVC API

I have an ASP.Net 4 website, not MVC, which is being authenticated using forms, and I need to equip its API. After googlage it seems the RESTful API will give the most accessibility.

I already have an asynchronous custom HTTP handler code for some Comet functions. I would like to use asynchronous handlers in the API to ensure that the IIS downstream is not tied, but to keep the performance optimal .

I would like to try to stay true and use the URI to access and modify resources. Are there design guides for this kind of thing, since it seems like a task that many developers face?

I am not sure whether to use one handler for the API that runs for all HTTP verbs or one handler for each type of resource, or several handlers derived from a common asynchronous handler. Any recommendations would be appreciated.

+5
source share
1 answer

In your situation, I just used the Web API . It is easy to integrate with WebForms projects , and basically it is done to perform REST in ASP.NET. Although the article does not show it, the web API allows you to use Task<> in your controllers , which makes it pleasant and asynchronous.

If you absolutely insist on saving all the ASP.NET MVC components from your WebForms project - even if they are fully compatible with each other - then I don’t know what to tell you, because doing it without MVC just seems counterproductive to me ; how to reinvent the wheel.

+2
source

Source: https://habr.com/ru/post/1237506/


All Articles