HttpException.GetHttpCode Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the HTTP response status code to return to the client.
public:
int GetHttpCode();
public int GetHttpCode();
member this.GetHttpCode : unit -> int
Public Function GetHttpCode () As Integer
A non-zero HTTP code representing the exception or the InnerException code; otherwise, HTTP response status code 500.
If there is a non-zero HTTP code, it is returned. Otherwise, the InnerException code is returned. If neither an InnerException code nor a non-zero HTTP code is available, the HTTP response status code 500 is returned. For more information on HTTP response status codes, see the Status Code Definitions of the Hypertext Transfer Protocol - HTTP/1.1 on the World Wide Web Consortium (W3C) Web site.
Product | Versions |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: