#3886·guzzle

Decompose Utils into focused APIs and internal services

Author: GrahamCampbellCreated Jul 16, 2026Updated Aug 5, 2026
Labelskind/enhancementkind/tech-debt

Guzzle 8 has already removed several unrelated Utils methods and moved no-proxy handling to ProxyOptions. We will finish separating the remaining responsibilities after 8.0.

  • Replace Utils::chooseHandler() with HandlerFactory::createDefault().
  • Replace Utils::headersFromLines() and Utils::normalizeHeaderKeys() with Headers::fromLines() and Headers::normalizeKeys().
  • Replace Utils::debugResource() with DebugResource::from().
  • Replace Utils::normalizeProtocols() with Protocols::normalize().
  • Move Utils::defaultUserAgent() to Client::defaultUserAgent().

The public replacements will land in 8.1. The old public methods will become exact PHPDoc-deprecated delegates, without runtime warnings, and will be removed in 9.0. Handler selection, exceptions, and diagnostics behavior will remain unchanged.