我正试图返回BadArguments Error以及正文中的自定义DTO:
var result = new HttpResult(response, "application/json", HttpStatusCode.BadRequest);
我尝试过使用HttpError、HttpResult、手动设置响应等,但我只得到了
HTTP/1.1 400 BadRequest
Cache-Control: private
Transfer-Encoding: chunked
Content-Type: text/html
Server: Microsoft-IIS/7.5
X-Powered-By: ServiceStack/3,22 Win32NT/.NET
X-Powered-On: ITDEVELOP36-PC
Test-Header-ValidationError: TestValidationError
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Thu, 26 Feb 2015 10:36:12 GMT
b
Bad Request
0
未设置正文,也未设置内容类型。我错过了什么?ServiceStack版本为3.3.6.29935。
戳了一段时间后,我发现ServiceStack框架工作得很好。即使是在我们使用的旧版本中。只有当web.config启用节时,问题才存在。去掉这个部分后,一切都很好。