PHP code example of ngabor84 / guzzle-escher-middleware

1. Go to this page and download the library: Download ngabor84/guzzle-escher-middleware library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ngabor84 / guzzle-escher-middleware example snippets




$credential = new \Guzzle\Http\Middleware\EscherCredential('key', 'secret', 'some/credential/scope');
$escherMiddleware = new \Guzzle\Http\Middleware\EscherMiddleware($credential);

$stack = \GuzzleHttp\HandlerStack::create();

$stack->push($escherMiddleware);

$client   = new \GuzzleHttp\Client(['handler' => $stack]);

// Important: set the auth option to escher to activate the middleware
$response = $client->get('http://www.8points.de', ['auth' => 'escher']);