fromCode static method

HttpStatus fromCode(
  1. int code
)

Implementation

static HttpStatus fromCode(int code) {
  return HttpStatus.values.firstWhere(
    (s) => s.code == code,
    orElse: () => throw ArgumentError('Unknown HTTP status code: $code'),
  );
}