valueOf static method

HttpStatus valueOf(
  1. int code
)

Returns the http status of code.

Implementation

static HttpStatus valueOf(final int code) {
  for (final status in values) {
    if (status.code == code) {
      return status;
    }
  }

  throw UnsupportedError('Unsupported value [$code].');
}