amphp/http
Event-driven HTTP primitives for PHP 8.1+ in the AMPHP ecosystem. Provides shared building blocks for HTTP clients and servers, including IANA status codes with default reasons, RFC 6265 cookie parsing/creation (Set-Cookie/Cookie), and header utilities.
Full Changelog: https://github.com/amphp/http/compare/v2.1.1...v2.1.2
Full Changelog: https://github.com/amphp/http/compare/v2.1.0...2.1.1
Full Changelog: https://github.com/amphp/http/compare/v1.7.2...v1.7.3
Full Changelog: https://github.com/amphp/http/compare/v1.7.1...v1.7.2
league/uri-components requirements to ^2.4.2 | ^7.1 as part of fixing #24 and allow psr/message@v2Full Changelog: https://github.com/amphp/http/compare/v2.0.0...v2.1.0
Status and Message to HttpStatus and HttpMessage respectivelyHttp2Processor::handleShutdown()Http2Parser constructor now requires an HPack instance to be injected, as well as providing parameters for upgrade settings, header size limit, and frame size limitsHttp2Parser::parse() was removed; Http2Parser now has a push() and cancel() methods to push received data and end parsingHttpRequest and HttpResponse as abstract base classes for requests and responsesHttpRequest now includes methods for getting and setting query parametersRfc7230 to Http1 sub-namespace.getRawHeaders() → getHeaderPairs(), parseRawHeaders() → parseHeaderPairs()mapHeaderPairs() function to convert header pairs returned from functions such as Rfc7230::parseHeaderPairs() into a map similar to that returned by Rfc7230::parseHeaders()int, float, or Stringable as an array value to HttpMessage::setHeaders() will cast the value to a string instead of throwing a TypeErrorparseFieldValueComponents() and createFieldValueComponentMap(), replacing them with four new functions:
splitHeaders() — Splits comma-separated fields into individual components. Returns null if a syntax error is encountered.parseMultipleHeaderFields() — Parses a list of key-value pairs from each comma-separated and semi-colon delineated header value. Returns null if a syntax error is encountered.parseSingleHeaderFields() — Parses a single semi-colon delineated header into key-value pairs.parseHeaderTokens() — Parses a list of tokens from comma-separated header values.Removed parseFieldValueComponents() and createFieldValueComponentMap(), replacing them with three new functions:
splitHeaders() — Splits comma-separated fields into individual components. Returns null if a syntax error is encountered.parseMultipleHeaderFields() — Parses a list of key-value pairs from each comma-separated and semi-colon delineated header value. Returns null if a syntax error is encountered.parseSingleHeaderFields() — Parses a single semi-colon delineated header into key-value pairs.HttpRequest and HttpResponse as abstract base classes for requests and responses. HttpRequest includes methods for getting and setting query parametersRfc7230 to Http1 sub-namespace.getRawHeaders() → getHeaderPairs(), parseRawHeaders() → parseHeaderPairs()convertHeaderPairsToMap() function to convert header pairs returned from functions such as Rfc7230::parseHeaderPairs() into a map similar to that returned by Rfc7230::parseHeaders().int, float, or Stringable as an array value to HttpMessage::setHeaders() will cast the value to a string instead of throwing a TypeError.Status and Message to HttpStatus and HttpMessage respectively. Aliases of the old names to the new names exist in this beta version, but may be removed before the stable releaseHttp2Processor::handleShutdown()Http2Parser constructor now requires an HPack instance to be injected, as well as providing parameters for upgrade settings, header size limit, and frame size limitsHttp2Parser::parse() was removed; Http2Parser now has a push() and cancel() methods to push received data and end parsing*, +, and . (#19)Http2Parserstrtolower calls, improving performanceHttp2Parser
It's not the task of a parser to apply policy decisions. Additionally, the current policy doesn't work correctly in all normal situations, e.g. larger uploads will trigger this in the client, because the server will send many window increments before sending any payload bytes.GOAWAY frames breaking the parser loop, no longer processing other frames.Http2Parser that parses HTTP/2 frames, calling methods on a class implementing Http2Processor.Message::getRawHeaders() to expose the original casing of headers. The API is limited to a single method returning all headers, as applications should never depend on the header casing as defined by the HTTP RFCs.Rfc7230::parseRawHeaders()Rfc7230::formatRawHeaders()Http2Parser that parses HTTP/2 frames, calling methods on a class implementing Http2Processor.formatDateHeader()SameSite attribute (#10)parseFieldValueComponentscreateFieldValueComponentMapRequestCookie and ResponseCookieResponseCookie (#2, #3)Message class to be used as a base-class for HTTP messages.Initial release.
How can I help you explore Laravel packages today?