Skip to content

koriym/Koriym.HttpConstants

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Koriym.HttpConstants

Contains the values of status codes, request method, and headers for the Hypertext Transfer Protocol (HTTP). Constants only.

Example

use Koriym\HttpConstants\HttpStatusCode;
use Koriym\HttpConstants\RequestHeader;
use Koriym\HttpConstants\ResponseHeader;
use Koriym\HttpConstants\MediaType;
use Koriym\HttpConstants\Method;

http_response_code(StatusCode::BAD_REQUEST);
header(ResponseHeader::CONTENT_TYPE . ': ' . MediaType::APPLICATION_JSON_API);
// Content-Type: application/vnd.api+json
header(ResponseHeader::CACHE_CONTROL . ': max-age=3600');
// Cache-Control: max-age=3600

Install

$ composer require koriym/http-constants

See also PSR Http Message Util.

About

Constants for the HTTP protocol

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages