iamxnuel / http-utility
Plain PHP HTTP utilities including Basic and Digest authentication, ideal for MJPEG streaming and REST APIs requiring authentication.
Installs: 1
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
pkg:composer/iamxnuel/http-utility
Requires
- php: ^8.0
README
HTTPUtility is a lightweight PHP library providing HTTP utilities, including Basic and Digest authentication handling, and tools for parsing HTTP headers.
This library was originally created to support MJPEG Restreaming from cameras that only support Digest authentication, as no existing solution fit this use case at the time. It is still useful for any REST API or HTTP client requiring authenticated requests.
Features
- Parse raw HTTP headers into structured arrays.
- Extract HTTP response codes and statuses.
- Parse
WWW-Authenticate
headers. - Handle Basic authentication headers.
- Handle Digest authentication headers including
nonce
,cnonce
, andqop
. - Build authorization headers for HTTP clients.
- Compatible with any PHP project using PHP 8+.
Installation
Install via Composer:
composer require iamxnuel/http-utility