Make a POST Request from PHP With Guzzle

I work extensively with APIs and a variety of serverside scripting languages, and best practice does change over time. Many of the most popular posts on my blog are10 years old because apparently, I was interesting in 2008. Two in particular from around that time relate to making POST requests from PHP, and I’d do it completely differently today. So, in an attempt to overcome some of the past crimes of the Internet in general and PHP in particular: here’s how to make a POST request in PHP, today, in a PHP 7+ world (it probably works in PHP 5 too).

Dependencies: GuzzleHTTP

Guzzle is brilliant. If you make web requests with PHP, use Guzzle. Guzzle actually does a bunch of other things too, but today, we’re making a POST request. https://goo.gl/yse3dE

Subscribe To Newsletter

Sign up for my newsletter and get the latest technology news

2019 © Craig Brown PhD. All rights reserved.