我尝试使用这个:
我尝试了这个:
但是当我浏览器中看到500错误时,任何类似于“My message”的信息都会显示出来。
return Request.CreateResponse(HttpStatusCode.InternalServerError, "My message");
我尝试了这个:
return new HttpStatusCodeResult(HttpStatusCode.InternalServerError, "My message");
但是当我浏览器中看到500错误时,任何类似于“My message”的信息都会显示出来。
HttpStatusCode.InternalServerError
是500错误。 - Floremin