HttpResponseMessage.IsSuccessStatusCode Property
Definition
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 a value that indicates whether the HTTP response was successful.
public:
property bool IsSuccessStatusCode { bool get(); };
bool IsSuccessStatusCode();
public bool IsSuccessStatusCode { get; }
var boolean = httpResponseMessage.isSuccessStatusCode;
Public ReadOnly Property IsSuccessStatusCode As Boolean
Property Value
bool
A value that indicates whether the HTTP response was successful. true
if HttpStatusCode is in the Successful range (200-299); otherwise, false
.
Remarks
If the server doesn't return a successful HttpStatusCode in the Successful range (200-299) for the request, then the HttpResponseMessage.IsSuccessStatusCode property is set to false
.
Calling HttpResponseMessage.EnsureSuccessStatusCode causes the value of IsSuccessStatusCode to be checked, and an exception thrown if that value is false
.