eightpoints/guzzle-wsse-plugin

此包已废弃,不再维护。作者建议使用eightpoints/guzzle-wsse-middleware包。

用于Guzzle的WSSE中间件,Guzzle是一个PHP HTTP客户端库和框架,用于构建RESTful Web服务客户端

v4.3.0 2019-08-09 06:54 UTC

This package is auto-updated.

Last update: 2019-08-13 10:02:18 UTC


README

此中间件将WSSE功能集成到Guzzle中,Guzzle是一个用于构建RESTful Web服务客户端的PHP框架。

要求

安装

使用composer

{
    "require": {
        "eightpoints/guzzle-wsse-middleware": "^4.1.1"
    }
}

使用方法

<?php 

$wsse = new \EightPoints\Guzzle\WsseAuthMiddleware($username, $password);

# Optional: Set createdAt by a expression (if not, current time will be used automatically)
# https://php.ac.cn/manual/en/datetime.formats.relative.php
# Useful if there is a small difference of time between client and server
# DateTime object will be regenerated for every request
$wsse->setCreatedAtTimeExpression('-10 seconds');

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

// Add the wsse middleware to the handler stack.
$stack->push($wsse->attach());

$client   = new \GuzzleHttp\Client(['handler' => $stack]);
$response = $client->get('http://www.8points.de');

作者

参见参与此项目的贡献者列表

许可证

此中间件采用MIT许可证 - 请参阅LICENSE文件以获取详细信息