1、什么是Web API
Web API是网络应用程序接口。包含了广泛的功能,网络应用通过API接口,可以实现服务交互的能力。
2、WebApi和WebService的区别
webApi的交互方式是使用的json数据来传递,更加轻量化的构建http服务框架
webserver是基于soap协议。
示例代码:
1、创建xxModel
1 public class ContactModel 2 { 3 public int ID { get; set; } 4 public string Name { get; set; } 5 public int Age { get; set; } 6 }