【发布时间】:2019-03-05 13:34:28
【问题描述】:
如何使用 BSON 格式的数据发出 HTTP 发布请求?
在.Net中我们可以用下面的代码来实现。
var bsonFormatter = new BsonMediaTypeFormatter(); response = httpClient.PostAsync(_endpoint, criteria, bsonFormatter).Result;
如何在 .net core 中实现同样的功能?
【问题讨论】:
如何使用 BSON 格式的数据发出 HTTP 发布请求?
在.Net中我们可以用下面的代码来实现。
var bsonFormatter = new BsonMediaTypeFormatter(); response = httpClient.PostAsync(_endpoint, criteria, bsonFormatter).Result;
如何在 .net core 中实现同样的功能?
【问题讨论】:
我使用了 nuget 包 Microsoft.AspNet.WebApi.Client 来解决这个问题。
【讨论】: