Runscope Plugin for the Guzzle PHP HTTP Client
PHP
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
src/Runscope/Plugin
tests
.gitignore
LICENSE
README.md
composer.json
phpspec.yml
phpunit.xml.dist

README.md

Guzzle plugin for Runscope

  • Requires a free Runscope account, sign up here
  • Automatically create Runscope URLs for your requests
  • Automatically create proper Runscope-Request-Port header when using ports
  • Support for authenticated buckets and service regions (see example below)

Install by issuing:

    ~ composer require runscope/guzzle-plugin

Usage is as follows:

<?php
require __DIR__ . '/../vendor/autoload.php';

use Guzzle\Http\Client;
use Runscope\Plugin\RunscopePlugin;

$client = new Client('https://api.github.com');

$runscopePlugin = new RunscopePlugin('bucket_key');

// authenticated bucket
// $runscopePlugin = new RunscopePlugin('bucket_key', 'authTokenHere');

// service region
// $runscopePlugin = new RunscopePlugin('bucket_key', null, 'eu1.runscope.net');

$client->addSubscriber($runscopePlugin);

// Send the request and get the response
$response = $client->get('/')->send();

Enjoy!