Skip to content

rayanlevert/http

Repository files navigation

Simple functionalites handling HTTP (codes and methods) via PHP enumerations (from 8.1)

Packagist Version PHP from Packagist codecov

Refer to php-fig https://github.com/php-fig/http-message-util

RayanLevert\Http\Codes

PHP enumeration with HTTP codes RayanLevert\Http\Codes

DisDev\Http\Methods

PHP enumeration with HTTP methods

enum Methods: string
{
    case HEAD    = 'HEAD';
    case GET     = 'GET';
    case POST    = 'POST';
    case PUT     = 'PUT';
    case PATCH   = 'PATCH';
    case DELETE  = 'DELETE';
    case PURGE   = 'PURGE';
    case OPTIONS = 'OPTIONS';
    case TRACE   = 'TRACE';
    case CONNECT = 'CONNECT';
}

\RayanLevert\Http\Methods::HEAD // 'HEAD'

RayanLevert\Http\Exception

PHP exception initialized with an HTTP code with RayanLevert\Http\Codes

// HTTP 401 error
$oException = new \RayanLevert\Http\Exception('Unauthorized', \RayanLevert\Http\Codes::CLIENT_UNAUTHORIZED)

About

PHP enumerations for HTTP codes and methods

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •  
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy