【发布时间】:2012-05-20 04:28:49
【问题描述】:
我正在尝试将复杂对象发送到 MVC4 Web api 控制器:
public class DnsController : ApiController
{
public IEnumerable<DnsARecord> GetDnsARecords(DnsServer dnsServer, string domainName)
{...
我希望从 HttpClient 调用它:
var httpClient = new HttpClient();
// Send a request asynchronously continue when complete
httpClient.GetAsync(dnsApiUrl).ContinueWith(...
我从"Introduction to HttpClient" 示例中借用的上述代码 - 代码在页面上列出。
我想知道我应该如何传递这两个参数。我假设需要进行一些预处理。
【问题讨论】:
标签: asp.net-mvc-4 asp.net-web-api