This is a past event. Please join us for Web Summer Camp this year.

Writing API clients with HTTPlug

Workshop abstract

PSR-7 defines common interfaces for HTTP requests and responses but the libraries that need to send HTTP requests need more than that. HTTPlug defines an interface for HTTP clients and provides adapters for existing clients like Guzzle, as well as a plugin system operating directly on PSR-7. This tool chain allows building API clients that do not depend on a specific HTTP client at all. This workshop by the two of the main authors of HTTPlug will cover: * Working with PSR-7 request and response * Using HTTPlug and the MessageFactory * Bootstrapping clients explicitly or with Puli * Using the PHP-HTTP plugin system * Strategies for writing an API client.

Workshop slides

Download slides 

Workshop repo

Get the repo 

Setting up a developer environment

Set up the developer environment in 3 simple steps:

  1. Install Virtual Box 5.*
  2. Download the appliance (size: 5GB; username: websc; password websc)
  3. Import the appliance to Virtual Box and run it

The appliance is based on Ubuntu and has all services needed by workshops installed. All code with git repos cloned is also in the appliance, you might need to do a git pull. You will need to reinstall PHPStorm since the demo license was valid for 30 days.

Remember to use a laptop with a processor capable of hardware virtualization and at least 4 GB of RAM (8 GB is highly recommended). Regular hard disk will do, but having an SSD is an advantage.

Workshop video

David Buchmann

David Buchmann

Liip AG

David works at Liip AG as a Symfony expert. He is maintaining the Symfony Content Management Framework, is a co-author of the FOSHttpCacheBundle, and is active with the PHP-HTTP HTTPlug client abstraction. When he is not coding, he enjoys music, boardgames, and travelling with his girlfriend.

Márk Sági-Kazár

Márk Sági-Kazár

deepblue networks AG

Márk works at deepblue networks AG as a web developer. He actively contributes to and maintains many open-source libraries (HTTPlug, Money, and SupervisorPHP, to name a few) and is passionate about learning new skills and experimenting with new techniques.