http_status_2 1.0.0 http_status_2: ^1.0.0 copied to clipboard
get http status code information
A library for debugging and displaying http status codes. Includes 63 status codes, messages and desciptions sourced from the official spec https://tools.ietf.org/html/rfc7234.
Usage #
A simple usage example:
import 'package:http_status/http_status.dart';
void main() {
HttpStatus status = getStatus(422);
print(status.formattedString); // -> 422 Unprocessable Entity
print(status.description); // -> The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions.
int code = status.code;
String message = status.message;
}
Features and bugs #
Please file feature requests and bugs at the issue tracker.