How to call the error code http 1.1 4xx 5xx? WITH#

How to make your application response with http 1.1 4xx 5xx error in C #?

+4
source share
1 answer

Throw an HttpException using the appropriate HttpStatusCode .

http://msdn.microsoft.com/en-us/library/system.web.httpexception.aspx

http://msdn.microsoft.com/en-us/library/system.net.httpstatuscode.aspx

Example:

 throw new HttpException((int) HttpStatusCode.NotImplemented, "Requested function not supported"); 
+4
source

All Articles