https://github.com/pear/http2
Miscellaneous HTTP utilities
https://github.com/pear/http2
Last synced: about 1 year ago
JSON representation
Miscellaneous HTTP utilities
- Host: GitHub
- URL: https://github.com/pear/http2
- Owner: pear
- License: other
- Created: 2012-01-15T21:53:13.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2023-03-22T20:23:06.000Z (over 3 years ago)
- Last Synced: 2025-03-24T04:03:34.813Z (over 1 year ago)
- Language: PHP
- Homepage: http://pear.php.net/HTTP2
- Size: 91.8 KB
- Stars: 12
- Watchers: 8
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
************************************
HTTP2 - Miscellaneous HTTP utilities
************************************
Static methods for doing miscellaneous HTTP related stuff like
date formatting, language negotiation or HTTP redirection.
Features
========
- Language negotiation
- MIME type negotiation
- Charset negotiation
- Send HEAD requests to URLs
- Make URLs absolute
- Parse HTTP ``Link:`` header values (RFC 5988)
Installation
============
::
$ composer require pear/http2
Usage
=====
Language negotiation
--------------------
Quality factors in the ``Accept-Language:`` header are supported, e.g.::
Accept-Language: en-UK;q=0.7, en-US;q=0.6, no, dk;q=0.8
Code::
'locales/en',
'en-US' => 'locales/en',
'en-UK' => 'locales/en',
'de' => 'locales/de',
'de-DE' => 'locales/de',
'de-AT' => 'locales/de',
);
$neg = $http->negotiateLanguage($langs);
$dir = $langs[$neg];
?>
Charset negotiation
-------------------
::
negotiateCharset($charsets);
?>
MIME type negotiation
---------------------
::
negotiateMimeType($contentType);
?>
Links
=====
Homepage
http://pear.php.net/package/HTTP2
Bug tracker
http://pear.php.net/bugs/search.php?cmd=display&package_name[]=HTTP2
Documentation
http://pear.php.net/package/HTTP2/docs
Unit test status
https://travis-ci.org/pear/HTTP2
.. image:: https://travis-ci.org/pear/HTTP2.svg?branch=master
:target: https://travis-ci.org/pear/HTTP2
Packagist
https://packagist.org/packages/pear/http2