如何触发http 1.1 4xx 5xx错误代码?c#
应用程序如何响应c#中的http 1.1 4xx 5xx错误?使用相应的如何触发http 1.1 4xx 5xx错误代码?c#,c#,web-services,http,restful-authentication,C#,Web Services,Http,Restful Authentication,应用程序如何响应c#中的http 1.1 4xx 5xx错误?使用相应的HttpStatusCode抛出HttpException 例如: throw new HttpException((int) HttpStatusCode.NotImplemented, "Requested function not supported");
HttpStatusCode
抛出HttpException
例如:
throw new HttpException((int) HttpStatusCode.NotImplemented, "Requested function not supported");