PHPackages                             lmc/http-constants - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. lmc/http-constants

ActiveLibrary[HTTP &amp; Networking](/categories/http)

lmc/http-constants
==================

HTTP Header Fields Constants

1.2.0(5y ago)25348.0k↓36.6%1[2 issues](https://github.com/lmc-eu/http-constants/issues)11MITPHPPHP ^7.2 || ^8.0CI failing

Since Jul 24Pushed 3y ago5 watchersCompare

[ Source](https://github.com/lmc-eu/http-constants)[ Packagist](https://packagist.org/packages/lmc/http-constants)[ RSS](/packages/lmc-http-constants/feed)WikiDiscussions main Synced 2d ago

READMEChangelogDependencies (4)Versions (7)Used By (11)

HTTP Header Fields Constants for PHP
====================================

[](#http-header-fields-constants-for-php)

[![Latest Stable Version](https://camo.githubusercontent.com/bd79c10a871aa3c748bf8056d8f633f5b7a867bdc457b896090b0ef9c44c341f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c6d632f687474702d636f6e7374616e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lmc/http-constants)[![GitHub Actions Build Status](https://camo.githubusercontent.com/ed8bc8349d3cf8fc3387369dabc03389f8e9ddcf1845dea5d7dd029a3017491b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6d632d65752f687474702d636f6e7374616e74732f74657374732e79616d6c3f7374796c653d666c61742d737175617265)](https://github.com/lmc-eu/http-constants/actions)[![Total Downloads](https://camo.githubusercontent.com/c56a457e9e369dd656a108b8fe4a35566f8e3154639aa8921dd024540880b9a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6d632f687474702d636f6e7374616e74732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lmc/http-constants)

The missing PHP constants definition for header fields of your HTTP requests and responses.

Stop repeating string identifiers and placing typos of HTTP headers in your code!

Could be used when interacting with headers using [pure PHP](https://www.php.net/manual/en/function.header.php), [Guzzle](https://github.com/guzzle/guzzle), [Symfony HttpFoundation](https://symfony.com/doc/current/components/http_foundation.html), [Zend HTTP](https://zendframework.github.io/zend-http/), [Zend Diactoros](https://zendframework.github.io/zend-diactoros/) etc.

Contains all ~200 constants for headers defined in [IANA list](https://www.iana.org/assignments/message-headers/message-headers.xml) (both Permanent and Provisional) and some common non-standard headers based on [Wikipedia list](https://en.wikipedia.org/wiki/List_of_HTTP_header_fields).

Install
-------

[](#install)

```
$ composer require lmc/http-constants
```

Note you will need to have [Composer](https://getcomposer.org/) installed to do this.

Usage
-----

[](#usage)

```
