http_status
3.3.3, released 3 years ago by andcan.dev
Provides Dart constants for all HTTP status codes and helper methods.
WASM-ready
What it does
Defines a class with immutable constants for every HTTP status code defined in RFC1945, RFC2616 and RFC2518. Includes methods to convert from numeric codes and to check code ranges (informational, success, redirect, client error, server error).
AI-written summary of version 3.3.3, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a lightweight, dependency‑free way to reference HTTP status codes.
- You want compile‑time safety and helper methods for status‑code categories.
Skip it when
- You need a full HTTP client or server implementation.
- You require dynamic status handling beyond the predefined constants.
Strengths
- Complete set of standard HTTP status codes
- Immutable and zero‑dependency
- Helper methods for range checks
Weaknesses
- Only provides constants, no networking features
- Cannot replace a full HTTP client
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 1
import 'package:http_status/http_status.dart';
void main() {
print(HttpStatus.ok); // 200
print(HttpStatus.fromCode(404)); // HttpStatus.notFound
print(HttpStatus.ok.isSuccessfulHttpStatusCode); // true
}Alternatives
Packages that do the same job and could replace http_status.
- http_status_code
A Dart library providing constants and helpers for HTTP status codes.
39Compare - functional_status_codes
Zero-cost HTTP status codes as int extension types with functional helpers.
65Compare