在Http Response Common中有550 Error,但我无法在HttpStatusCode Enumeration找到它。
JavaScriptSerializer sr = new JavaScriptSerializer();
OTPOutError_Model oError = new OTPOutError_Model();
oError.message = "Business exception. ";
var httpContent = new StringContent(sr.Serialize(oError), Encoding.UTF8, "application/json");
var msg = new HttpResponseMessage(HttpStatusCode.HttpVersionNotSupported) { ReasonPhrase = "550", Content = httpContent };
throw new HttpResponseException(msg);
如何退回响应状态550?是否有枚举更新?
在示例代码中,我使用505 / HttpStatusCode.HttpVersionNotSupported。我需要的是550而不是505。