有一个
WebOperationContext您可以访问的
OutgoingResponse属性,并且它具有一个类型可以设置
OutgoingWebResponseContext的
StatusCode属性。
WebOperationContext ctx = WebOperationContext.Current;ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;

有一个
WebOperationContext您可以访问的
OutgoingResponse属性,并且它具有一个类型可以设置
OutgoingWebResponseContext的
StatusCode属性。
WebOperationContext ctx = WebOperationContext.Current;ctx.OutgoingResponse.StatusCode = System.Net.HttpStatusCode.OK;