【发布时间】:2013-04-01 15:14:05
【问题描述】:
当我像这样在 RestSharp 中提出请求时:
var response = client.Execute<bool>(request);
我收到以下错误:
"Unable to cast object of type 'System.Boolean' to type 'System.Collections.Generic.IDictionary`2[System.String,System.Object]'."
这是完整的 HTTP 响应,每个 Fiddler:
HTTP/1.1 200 OK
Cache-Control: no-cache
Pragma: no-cache
Content-Type: application/json; charset=utf-8
Expires: -1
Server: Microsoft-IIS/7.5
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Mon, 01 Apr 2013 15:09:14 GMT
Content-Length: 5
false
似乎所有的反应都是犹太教的,所以什么给出了?
另外,如果我通过返回一个简单的值而不是一个对象来使用我的 WebAPI 控制器做一些愚蠢的事情并且可以解决我的问题,请随时提出建议。
【问题讨论】:
标签: restsharp