Diving Into Guzzle: Getting the Most from Your Requests (@ UpstatePHP)
Details
Often in our applications we need to make HTTP requests to external services either to integrate with an API, upload a file to S3, or perform some other action that requires us to interface over HTTP. PHP doesn’t natively make these requests user friendly so many of us turn to the 3rd-party library Guzzle. But how well do you know Guzzle beyond the basics?
Guzzle is much more than syntactic sugar for HTTP requests. PHP is a synchronous language by nature, but did you know that you can make asynchronous HTTP requests out of the box with Guzzle? It’s functionality extends even further with support for custom request handlers and middleware.
In this talk we’ll start with some basic example requests using Guzzle. Then we’ll look at extending our requests with middleware such as logging, retry middleware, handling failed requests, and mapping responses from 3rd-party APIs. From there, we’ll refactor our synchronous requests to be asynchronous using promises and generators to process our async responses. Finally, we’ll look at how to test our requests without needing to send them over the internet. You’ll leave this presentation with a deeper understanding of the power of Guzzle, how to extend it with your own middleware, how to speed up your application with async requests and how to test your requests without external dependencies.
---
Enter through the door on the third floor of the Richardson Street parking garage.
