ASP.NET Web API

REST:一種軟件架構風格,它是一種針對網絡應用的設計和開發方式,能夠下降開發的複雜性,提升系統的可伸縮性。(用這個Web API能夠很容易地實現REST化的HTTP服務,目前在三種主流的Web服務實現方案中,由於REST模式的Web服務與複雜的SOAP和XML-RPC對比來說明顯的更加簡潔,愈來愈多的web服務開始採用REST風格設計和實現。例如,Amazon.com提供接近REST風格的Web服務進行圖書查找;雅虎提供的Web服務也是REST風格的。)web

ASP.NET Web API是一個用來在.NET框架上創建Web API的框架。網絡

A model is an object that represents the data in your application.架構

A controller is an object that handles HTTP requestst. app

  • HomeController is a traditional ASP.NET MVC controller. It is responsible for serving HTML pages for the site, and is not directly related to Web API.
  • ValuesController is an example WebAPI controller.

Note If you have worked with ASP.NET MVC, then you are already familiar with controllers. They work similarly in Web API, but controllers in Web API derive from the ApiController class instead of Controller class. The first major difference you will notice is that actions on Web API controllers do not return views, they return data.框架

相關文章
相關標籤/搜索