runscope/guzzle-plugin

该软件包为Guzzle PHP库添加了Runscope支持。

该软件包的官方仓库似乎已不存在,因此该软件包已被冻结。

dev-master 2013-10-29 17:35 UTC

This package is not auto-updated.

Last update: 2021-01-18 07:42:57 UTC


README

Guzzle 插件用于Runscope

  • 需要免费Runscope账户,在此注册
  • 自动为您请求创建Runscope URL
  • 使用端口时自动创建正确的 Runscope-Request-Port 标头
  • 支持认证存储桶和服务区域(见以下示例)

通过以下命令安装

    ~ composer require runscope/guzzle-plugin

用法如下

<?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();

祝您使用愉快!