http_methods
1.1.1, released 4 years ago by google.dev
Provides a list of IANA‑registered HTTP methods and helper functions to check them.
WASM-readyQuiet but busy
What it does
Exports constants with all registered HTTP method names and metadata such as safety and idempotence. Includes utility functions like isHttpMethod to validate a method string.
AI-written summary of version 1.1.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need a reliable source of all standard HTTP methods
- You want to validate or normalize method strings without pulling in a full HTTP client
Skip it when
- You already have an HTTP client that supplies its own method list
- You need advanced networking features beyond method validation
Strengths
- Zero dependencies
- Small footprint
- Accurate, up‑to‑date IANA data
Weaknesses
- Only provides method data, no networking capabilities
- No runtime updates if IANA adds new methods
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 0
import 'package:http_methods/http_methods.dart';
void main() {
assert(isHttpMethod('GET'));
print(httpMethods);
}Alternatives
Packages that do the same job and could replace http_methods.
Works with
Packages commonly used together with http_methods: ones it builds on, ones built on it, and its own family.
- shelf_routerBuilt on http_methodsA request router for the shelf web-framework with support for URL parameters and nested routers.
- dart_frogBuilt on http_methodsA minimalistic Dart backend framework with a built‑in dev server and Docker support.
- shelf_router_generatorBuilt on http_methodsGenerate request routers for the shelf web-framework using source annotations.