Skip to content

Instantly share code, notes, and snippets.

View palaueb's full-sized avatar

Marc palaueb

View GitHub Profile
@sloanlance
sloanlance / guzzle.md
Created March 2, 2017 18:13
PHP: Guzzle as replacement for direct use of Curl or PECL HTTP modules.

Copied from: https://github.com/IMSGlobal/caliper-php/issues/126#issuecomment-226624750

I've recently learned that Guzzle is a popular HTTP client library for PHP: http://guzzlephp.org/

This package has a lot of nice features, including:

  • Simple interface for building query strings, POST requests, streaming large uploads, streaming large downloads, using HTTP cookies, uploading JSON data, etc...
  • Can send both synchronous and asynchronous requests using the same interface.
  • Uses PSR-7 interfaces for requests, responses, and streams. This allows you