Web API Basics
An API returns data (usually JSON) rather than HTML pages.
Creating a Controller:
csharp [ApiController] [Route("[controller]")] public class UsersController : ControllerBase { [HttpGet] public string Get() => "Hello API"; }
[ApiController]: Enables API-specific features.[HttpGet]: Marks the method to respond to HTTP GET requests.