isHttpStatusOK function

bool isHttpStatusOK(
  1. int? status
)

Whether the HTTP status code is a successful response (2xx range). Null, redirects (3xx), informational (1xx), and error codes return false.

For an http.Response, prefer isResponseOK(resp) (in io.dart).

Implementation

bool isHttpStatusOK(int? status) => status != null && status >= 200 && status < 300;