相比json来说,好处是速度更快,带宽占用更小.其效果大致等于json+Gzip. 在webapi中使用protobuf的方法为: 引用nuget包 Install-Package protobuf-net 为DTO添加注解 [ProtoContract] public class Product { [ProtoMember()] public int Id { get; set; } [ProtoMember()] public string Name { get; set; } [Pro…