【发布时间】:2019-03-16 09:27:54
【问题描述】:
我有 .NET Core WebApi 项目,我想在 BSON 中发送请求并获得响应。
我安装了WebApiContrib.Core.Formatter.Bson并添加了
services.AddMvc().AddBsonSerializerFormatters();
在Startup.cs 中ConfigureServices。
我还需要做什么吗?
我在控制器中有测试方法:
[HttpGet]
public string GetTestBson()
{
return "test string bson";
}
我尝试使用 Postman 对其进行测试,在标题中我有 Content-Type: application/bson
但作为回应,我没有 BSON……我有 "test string bson"
我做错了什么?
【问题讨论】:
标签: c# asp.net-web-api asp.net-core postman bson