gapple / structured-headers
This package is abandoned and no longer maintained.
The author suggests using the gapple/structured-fields package instead.
Library for Structured Field Values for HTTP
v2.1.1
2024-02-13 22:15 UTC
Requires
- php: ^7.3 || ^8.0
- ext-json: *
Requires (Dev)
- httpwg/structured-field-tests: *@dev
- paragonie/constant_time_encoding: ^2.6.3
- phpstan/phpstan: ^1.9
- phpstan/phpstan-phpunit: ^1.3
- phpunit/phpunit: ^9.5.27
- squizlabs/php_codesniffer: ^3.7.1
This package is auto-updated.
Last update: 2024-02-14 08:03:54 UTC
README
Parser and serializer for the Structured Field Values for HTTP specification.
Installation
Using composer:
composer require gapple/structured-fields
API
The Parser
class provides static methods to convert a header string to structured data.
If the string cannot be parsed, a ParseException
is thrown.
Parser::parseItem(string): Item;
Parser::parseList(string): OuterList;
Parser::parseDictionary(string): Dictionary;
The Serializer
class provides static methods to convert structured data to a header string.
If the input cannot be serialized, a SerializeException
is thrown.
Serializer::serializeItem(mixed, ?object): string;
Serializer::serializeList(iterable): string;
Serializer::serializeDictionary(object): string;