response.ok 是否适用于任何 2xx HTTP 状态?

Is response.ok true for any 2xx HTTP status?

对于任何 2xx HTTP 状态,response.ok 都是真的吗?如果是这样,为什么?不应该只针对 200 状态码吗?

获取规范状态,响应 returns true if the response status has an OK status

An ok status is a status in the range 200 to 299, inclusive.

原因似乎是,2xx 状态会产生成功响应,这在 RESTful 世界中对于 201、206 等非常常见。