Writing API clients with HTTPlug
summary
Shows how to build a reusable PHP API client for a small to‑do REST API using PSR-7 requests, the HTTPlug client interface and Guzzle adapters, plus a MessageFactory and plugin chain (for example the ad-host plugin). The workshop builds create/get/update operations that handle 200/204/404 codes, wraps transport exceptions into domain exceptions via a sendRequest helper, uses an HTTPlug mock client for unit tests asserting requests and error mapping, and demonstrates Symfony integration and the debug toolbar.
AI-written summary · about
chapters (5)
- 0:00Start
- 5:38PSR-7 flow
- 20:41HTTPlug Asynchronous
- 28:15Composer in a library
- 31:51Composer in an application
related talks
46mPSR-18: Abstracting HTTP clients in PHP
52mWeb API and client generation using OpenAPI specification
31mTesting API's written in PHP using the Behat feature testing tool
50mBuild RESTful APIs easily with Symfony
57mBuilding first-class REST APIs with Symfony
47mAPI Tips from the Frontline
41mBuilding first-class REST APIs with Symfony
34mTesting APIs written in PHP using the Behat feature testing tool
