如何访问ServiceStack v4 ServiceClient中的HTTP标头?

时间:2014-02-02 22:47:28

标签: servicestack

在ServiceStack v3中,我可以使用HttpStatusCode检查LocationLocalHttpWebResponseFilter标头:

var client = new JsvServiceClient(ServiceUrl);
client.LocalHttpWebResponseFilter = delegate(HttpWebResponse httpRes)
{
    Assert.AreEqual(httpRes.StatusCode, HttpStatusCode.Created);
};

相关文章:POST to ServiceStack Service and retrieve Location Header

ServiceStack v4中缺少过滤器。我找不到任何替代品。是否仍然支持检查HTTP标头?

1 个答案:

答案 0 :(得分:2)

刚刚将以下内容添加到v4.0 Release Notes Changes

  • 服务客户端中的 LocalHttpWebRequestFilter LocalHttpWebResponseFilter 已重命名为RequestFilterResponseFilter
  • 全局 HttpWebRequestFilter HttpWebResponseFilter 过滤器也分别重命名为GlobalRequestFilterGlobalResponseFilter