在ServiceStack v3中,我可以使用HttpStatusCode
检查Location
或LocalHttpWebResponseFilter
标头:
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标头?
答案 0 :(得分:2)
刚刚将以下内容添加到v4.0 Release Notes Changes:
RequestFilter
和ResponseFilter
GlobalRequestFilter
和GlobalResponseFilter
。