-1

when making a c# controller,

  • what is the difference between API controller and controller base?
  • when using HTTP attributes?

My question is that there are controllers that don't use HTTP attributes and everything works fine, I was wondering how this controller distinguishes HTTP put, HTTP post and HTTP get? Why didn't they use HTTP attributes? Knowing that it is an API controller.

1 Answers1

0

Web API Controller is similar to ASP.NET MVC controller. It handles incoming HTTP requests and send response back to the caller. It must be derived from System.Web.Http.ApiController class.

Base Controllers are C# classes inheriting from System.Web.Mvc.Controller, which is the builtin controller base class.

The Controller knows the difference between the Put Post Delete Get methods by default with the help pf URL where the API call mentioned there. you can invoke it from the Web via some URL to perform an action.

Arun_Raja1
  • 207
  • 1
  • 1