Download the PHP package studiow/http-exceptions without Composer

On this page you can find all versions of the php package studiow/http-exceptions. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package http-exceptions

Http Exceptions

A helper package for throwing HTTP Exceptions (4xx - 5xx)

Installation

The easiest way to install this package is using composer:

Throwing exceptions

The package provides dedicated Exceptions for each of the 4xx and 5xx error status codes. You throw them like you would throw any other exception:

Outputting to Json

All of the exceptions have a toJsonResponse method. This method expects a PSR-7 ResponseInterface object and will return a a PSR-7 ResponseInterface object with the appropriate headers, status code and reason phrase set.

Exception overview

Client Error (4xx)

Status Code Reason Phrase Class name
400 Bad Request \Studiow\Http\Exceptions\ClientError\BadRequestException
401 Unauthorized \Studiow\Http\Exceptions\ClientError\UnauthorizedException
402 Payment Required \Studiow\Http\Exceptions\ClientError\PaymentRequiredException
403 Forbidden \Studiow\Http\Exceptions\ClientError\ForbiddenException
404 Not Found \Studiow\Http\Exceptions\ClientError\NotFoundException
405 Method Not Allowed \Studiow\Http\Exceptions\ClientError\MethodNotAllowedException
406 Not Acceptable \Studiow\Http\Exceptions\ClientError\NotAcceptableException
407 Proxy Authentication Required \Studiow\Http\Exceptions\ClientError\ProxyAuthenticationRequiredException
408 Request Timeout \Studiow\Http\Exceptions\ClientError\RequestTimeoutException
409 Conflict \Studiow\Http\Exceptions\ClientError\ConflictException
410 Gone \Studiow\Http\Exceptions\ClientError\GoneException
411 Length Required \Studiow\Http\Exceptions\ClientError\LengthRequiredException
412 Precondition Failed \Studiow\Http\Exceptions\ClientError\PreconditionFailedException
413 Payload Too Large \Studiow\Http\Exceptions\ClientError\PayloadTooLargeException
414 URI Too Long \Studiow\Http\Exceptions\ClientError\URITooLongException
415 Unsupported Media Type \Studiow\Http\Exceptions\ClientError\UnsupportedMediaTypeException
416 Range Not Satisfiable \Studiow\Http\Exceptions\ClientError\RangeNotSatisfiableException
417 Expectation Failed \Studiow\Http\Exceptions\ClientError\ExpectationFailedException
418 I'm a Teapot \Studiow\Http\Exceptions\ClientError\ImaTeapotException
421 Misdirected Request \Studiow\Http\Exceptions\ClientError\MisdirectedRequestException
422 Unprocessable Entity \Studiow\Http\Exceptions\ClientError\UnprocessableEntityException
423 Locked \Studiow\Http\Exceptions\ClientError\LockedException
424 Failed Dependency \Studiow\Http\Exceptions\ClientError\FailedDependencyException
425 Too Early \Studiow\Http\Exceptions\ClientError\TooEarlyException
426 Upgrade Required \Studiow\Http\Exceptions\ClientError\UpgradeRequiredException
428 Precondition Required \Studiow\Http\Exceptions\ClientError\PreconditionRequiredException
429 Too Many Requests \Studiow\Http\Exceptions\ClientError\TooManyRequestsException
431 Request Header Fields Too Large \Studiow\Http\Exceptions\ClientError\RequestHeaderFieldsTooLargeException
451 Unavailable For Legal Reasons \Studiow\Http\Exceptions\ClientError\UnavailableForLegalReasonsException

Server Error (5xx)

Status Code Reason Phrase Class name
501 Not Implemented \Studiow\Http\Exceptions\ServerError\NotImplementedException
502 Bad Gateway \Studiow\Http\Exceptions\ServerError\BadGatewayException
503 Service Unavailable \Studiow\Http\Exceptions\ServerError\ServiceUnavailableException
504 Gateway Timeout \Studiow\Http\Exceptions\ServerError\GatewayTimeoutException
505 HTTP Version Not Supported \Studiow\Http\Exceptions\ServerError\HTTPVersionNotSupportedException
506 Variant Also Negotiates \Studiow\Http\Exceptions\ServerError\VariantAlsoNegotiatesException
507 Insufficient Storage \Studiow\Http\Exceptions\ServerError\InsufficientStorageException
508 Loop Detected \Studiow\Http\Exceptions\ServerError\LoopDetectedException
510 Not Extended \Studiow\Http\Exceptions\ServerError\NotExtendedException
511 Network Authentication Required \Studiow\Http\Exceptions\ServerError\NetworkAuthenticationRequiredException

All versions of http-exceptions with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
ext-json Version *
psr/http-message Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package studiow/http-exceptions contains the following files

Loading the files please wait ....