Added EnsureSuccessStatusCode.