Nathaniel McHugh

Nathaniel McHugh

Easy HTTP Clients with Guzzle

Nathaniel McHugh works as a Senior Software Engineer for Plusnet an ISP based in Sheffield, England. He has been using PHP professionally for seven years and is trying to teach himself C and PHP extension development. He gets far too much pleasure from running each PHP release on production in a couple of hours of release. Outside of work three young children take up most of his time but occasionally manages to do some brewing, cycling and running.

Easy HTTP Clients with Guzzle

With application architectures such as REST increasingly making use of web services, sending HTTP requests from PHP has become a common requirement. With this in mind a reusable component that can talk HTTP for us has become a must.

Originating as part of the AWS SDK for PHP Guzzle is a library that has become a popular choice and is now integrated into several other projects including Drupal 8. What makes Guzzle so attractive for developers is as well as acting as a versatile HTTP Client it offers a framework to tailor clients to a particular web service by describing them in Guzzle’s own DSL.

Starting with a REST like service we want to talk to, this talk will go through the process of building a HTTP client that allows the interaction with the remote resources in a robust and elegant way. Writing just enough code to specify the client and along the way offering plenty of tips on how to unit test and extend your client and also how best to integrate it within your application.