HttpResponseMessage.EnsureSuccessStatusCode HttpResponseMessage.EnsureSuccessStatusCode HttpResponseMessage.EnsureSuccessStatusCode HttpResponseMessage.EnsureSuccessStatusCode HttpResponseMessage.EnsureSuccessStatusCode Method

Definition

Throws an exception if the IsSuccessStatusCode property for the HTTP response is false.

public : HttpResponseMessage EnsureSuccessStatusCode()
HttpResponseMessage EnsureSuccessStatusCode() const;
public HttpResponseMessage EnsureSuccessStatusCode()
Public Function EnsureSuccessStatusCode() As HttpResponseMessage
var httpResponseMessage = httpResponseMessage.ensureSuccessStatusCode();

Returns

Remarks

This method will throw an exception if the server doesn't return a successful HttpStatusCode in the Successful range (200-299) for the request.

See also