Bre*_*eak 3 .net wcf http-status-code-404
曾经,为了完全控制HTTP消息的头部/主体 - 我使用Message类.例如,要返回一些XML,我会调用
public Message ShowRunResults()
{
// some [OperationContract] implementation
webContext.CreateTextResponse(result.ToString(), "application/xml", Encoding.ASCII);
}
Run Code Online (Sandbox Code Playgroud)
问题是如何返回404未找到或其他HTTP代码?非常感谢