PSR-18


Abstracting HTTP Clients in PHP


PHP Benelux, Antwerp - January 26th, 2019

© David Buchmann

What is the difference between

guzzle/guzzle

and

guzzlehttp/guzzle?

Depending on an implementation


Once upon a time

FOSHttpCache needs to send HTTP requests to varnish for cache invalidation

HTTPlug

=> Márk Sági-Kazár

PHP Framework Interoperability Group (PHP-FIG)

HTTP Request and Response: PSR-7

How to create an object without knowing the class?

interface RequestFactoryInterface
{
    function createRequest(string $method, $uri)
               : RequestInterface;
}

HTTP Message Factories: PSR-17

=> Woody Gilk

How to send that request?

interface ClientInterface
{
  function sendRequest(RequestInterface $request)
           : ResponseInterface;
}

What is PSR-18?

HTTP Clien