PHP code example of eightpoints / guzzle-wsse-plugin
1. Go to this page and download the library: Download eightpoints/guzzle-wsse-plugin 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/ */
eightpoints / guzzle-wsse-plugin example snippets
php
$wsse = new \EightPoints\Guzzle\WsseAuthMiddleware($username, $password);
# Optional: Set createdAt by a expression (if not, current time will be used automatically)
# http://php.net/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');