Consuming HTTP APIs in PHP the Right Way!
summary
Shows concrete code using symfony/http-client and php-http/discovery to build a PSR-18/PSR-17 based PHP SDK that creates requests, streams uploads and SSE responses (used for OpenAI-style streams), and handles concurrent deletes by scheduling lazy responses. Demonstrates a community fix that reduces 2k open connections→almost zero and explains how the composer plugin installs missing client so an SDK can require only virtual packages. Claims work in practice but adoption lags: ~30,000 packages require Guzzle while only ~354 use the discovery approach.
AI-written summary · about
chapters (14)
- 0:00Introduction to HTTP client
- 1:10Practical code examples
- 4:36Concurrent requests
- 6:37Configuration and setup
- 9:51Community-driven performance
- 12:21Advanced streaming features
- 14:08Extended client capabilities
- 15:37Core benefits and design
- 19:07Interoperability in PHP
- 21:15Challenges with current SDKs
- 27:16Discovery for interoperability
- 29:58Implementing PSR-18 clients
- 33:04Composer automation magic
- 35:47Call to action for adoption
