ASP.NET Web API

REST:一种软件架构风格,它是一种针对网络应用的设计和开发方式,可以降低开发的复杂性,提高系统的可伸缩性。(用这个Web API可以很容易地实现REST化的HTTP服务,目前在三种主流的Web服务实现方案中,因为REST模式的Web服务与复杂的SOAP和XML-RPC对比来讲明显的更加简洁,越来越多的web服务开始采用REST风格设计和实现。例如,Amazon.com提供接近REST风格的Web服务进行图书查找;雅虎提供的Web服务也是REST风格的。)

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. 

  • 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.

posted on 2016-08-30 10:17  ゞWXXoοО  阅读(195)  评论(0编辑  收藏  举报