library http-status-in-range
Utility to check if a HTTP status code is present in a given range.
frankdejonge/http-status-in-range
Utility to check if a HTTP status code is present in a given range.
- Thursday, June 28, 2018
- by frankdejonge
- Repository
- 1 Watchers
- 13 Stars
- 0 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 3 Forks
- 0 Open issues
- 2 Versions
- 0 % Grown
HTTP Status Range Checker
composer require frankdejonge/http-status-in-range
<?php
use function FrankDeJonge\HttpStatusRange\http_status_in_range;
use function FrankDeJonge\HttpStatusRange\http_status_not_in_range;
use const FrankDeJonge\HttpStatusRange\HTTP_SUCCESS;
$response = $httpClient->get('/something');
if (http_status_in_range($response->getStatusCode(), HTTP_SUCCESS)) {
// SUCCESS!
}
if (http_status_not_in_range($response->getStatusCode(), HTTP_SUCCESS)) {
// NOT SUCCESS!
}
Ranges:
-
HTTP_INFORMATIONAL
100-199
-
HTTP_SUCCESS
200-299
-
HTTP_REDIRECT
300-399
-
HTTP_CLIENT_ERROR
400-499
-
HTTP_SERVER_ERROR
500-599
dev-master
9999999-dev
Utility to check if a HTTP status code is present in a given range.
Sources
Download
MIT
The Requires
The Development Requires
by
Frank de Jonge
1.0.0
1.0.0.0
Utility to check if a HTTP status code is present in a given range.
Sources
Download
MIT
The Requires
The Development Requires
by
Frank de Jonge