Although HTTP was originally designed to request and respond with HTML and other resources for humans to look at, it is also good for building services. Roy Fielding stated in his doctoral dissertation, describing the Representational State Transfer (REST) architectural style, that the HTTP standard defines the following:
- URLs to uniquely identify resources
- Methods to perform common tasks, such as
GET
,POST
,PUT
, andDELETE
- The ability to negotiate media formats, such as XML and JSON
Web services are services that use the HTTP communication standard, so they are sometimes called HTTP or RESTful services.
To allow the easy creation of web services, ASP.NET Core has combined what used to be two types of controller.
In earlier versions of ASP.NET, you would derive web services from ApiController
to create a Web API service and then register API routes in the same route table that MVC uses.
With ASP.NET Core, you...