yggvault ratatoskr-space connected via regular web
Color theme
also available via yggdrasil mesh http://[203:b338:2a84:a18f:986:47ae:1a4:d8d3]/pkg/guzzle/6.0.0
vault / guzzle / 6.0.0

guzzle @ 6.0.0

integrity

size
88.0 KiB
downloaded
last checked
overlays
composer
detected
composer guzzlehttp/guzzle
source https://github.com/guzzle/guzzle · available · github

release notes

Guzzle now uses PSR-7 for HTTP messages. Due to the fact that these messages are immutable, this prompted a refactoring of Guzzle to use a middleware based system rather than an event system. Any HTTP message interaction (e.g., GuzzleHttp\Message\Request) need to be updated to work with the new immutable PSR-7 request and response objects. Any event listeners or subscribers need to be updated to become middleware functions that wrap handlers (or are injected into a GuzzleHttp\HandlerStack).

Migrating to middleware

The change to PSR-7 unfortunately required significant refactoring to Guzzle due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event system from plugins. The event system relied on mutability of HTTP messages and side effects in order to work. With immutable messages, you have to change your workflow to become more about either returning a value (e.g., functional middlewares) or setting a value on an object. Guzzle v6 has chosen the functional middleware approach.

Instead of using the event system to listen for things like the before event, you now create a stack based middleware function that intercepts a request on the way in and the promise of the response on the way out. This is a much simpler and more predictable approach than the event system and works nicely with PSR-7 middleware. Due to the use of promises, the middleware system is also asynchronous.

v5:

use GuzzleHttp\Event\BeforeEvent;
$client = new GuzzleHttp\Client();
// Get the emitter and listen to the before event.
$client->getEmitter()->on('before', function (BeforeEvent $e) {
    // Guzzle v5 events relied on mutation
    $e->getRequest()->setHeader('X-Foo', 'Bar');
});

v6:

In v6, you can modify the request before it is sent using the mapRequest middleware. The idiomatic way in v6 to modify the request/response lifecycle is to setup a handler middleware stack up front and inject the handler into a client.

use GuzzleHttp\Middleware;
// Create a handler stack that has all of the default middlewares attached
$handler = GuzzleHttp\HandlerStack::create();
// Push the handler onto the handler stack
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
    // Notice that we have to return a request object
    return $request->withHeader('X-Foo', 'Bar');
});
// Inject the handler into the client
$client = new GuzzleHttp\Client(['handler' => $handler]);

download

unix · zip
curl -fL -o 6.0.0.zip https://ratatoskr.space/pkg/guzzle/6.0.0.zip
                    printf '%s  %s\n' '7027e8639a88e310d7f8c7dc984ac5fe66f93df808f6754aa73d0508790e9e10' '6.0.0.zip' | sha256sum -c -
windows · zip
$url = "https://ratatoskr.space/pkg/guzzle/6.0.0.zip"
$out = "6.0.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "7027e8639a88e310d7f8c7dc984ac5fe66f93df808f6754aa73d0508790e9e10") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o 6.0.0.tar.gz https://ratatoskr.space/pkg/guzzle/6.0.0.tar.gz
                    printf '%s  %s\n' '8bd5dc77bacd07c8588e983bdb49b23bacf57178784e63da32e67860392c7e49' '6.0.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "https://ratatoskr.space/pkg/guzzle/6.0.0.tar.gz"
$out = "6.0.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "8bd5dc77bacd07c8588e983bdb49b23bacf57178784e63da32e67860392c7e49") { throw "sha256 mismatch" }
download via yggdrasil mesh
unix · zip
curl -fL -o 6.0.0.zip http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.zip
                    printf '%s  %s\n' '7027e8639a88e310d7f8c7dc984ac5fe66f93df808f6754aa73d0508790e9e10' '6.0.0.zip' | sha256sum -c -
windows · zip
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.zip"
$out = "6.0.0.zip"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "7027e8639a88e310d7f8c7dc984ac5fe66f93df808f6754aa73d0508790e9e10") { throw "sha256 mismatch" }
unix · tar.gz
curl -fL -o 6.0.0.tar.gz http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.tar.gz
                    printf '%s  %s\n' '8bd5dc77bacd07c8588e983bdb49b23bacf57178784e63da32e67860392c7e49' '6.0.0.tar.gz' | sha256sum -c -
windows · tar.gz
$url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.tar.gz"
$out = "6.0.0.tar.gz"
Invoke-WebRequest -Uri $url -OutFile $out
if ((Get-FileHash $out -Algorithm SHA256).Hash.ToLowerInvariant() -ne "8bd5dc77bacd07c8588e983bdb49b23bacf57178784e63da32e67860392c7e49") { throw "sha256 mismatch" }
artifact format size hashes
6.0.0.zip zip 87.7 KiB
blake3-24 5b554dd1ad248b6cddbc475f76fef94478e0c0c20439b886
sha256 7027e8639a88e310d7f8c7dc984ac5fe66f93df808f6754aa73d0508790e9e10
sha1 2742358cd72c142c3645cae22579bc878e94ac88
6.0.0.tar.gz tar.gz 70.9 KiB
blake3-24 8fb97ec745d1f021d84e978d0ff6af832b7e7cdc88c98d33
sha256 8bd5dc77bacd07c8588e983bdb49b23bacf57178784e63da32e67860392c7e49
sha1 0e190290ac5beb7353a7d5de788b9b139ef148b9

install

bazel
http_archive(
    name = "guzzle",
    urls = ["https://ratatoskr.space/pkg/guzzle/6.0.0.tar.gz"],
    integrity = "sha256-i9Xcd7rNB8hYjpg720myO6z1cXh4TmPaMuZ4YDksfkk=",
    strip_prefix = "guzzle-6.0.0",
)
zig
.url = "https://ratatoskr.space/pkg/guzzle/6.0.0.tar.gz",
composer
composer config repositories.yggvault composer https://ratatoskr.space/pkg
composer require guzzlehttp/guzzle:6.0.0
install via yggdrasil mesh
bazel
http_archive(
    name = "guzzle",
    urls = ["http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.tar.gz"],
    integrity = "sha256-i9Xcd7rNB8hYjpg720myO6z1cXh4TmPaMuZ4YDksfkk=",
    strip_prefix = "guzzle-6.0.0",
)
zig
.url = "http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg/guzzle/6.0.0.tar.gz",
composer
composer config secure-http false
composer config repositories.yggvault composer http://14cc7d57b5e70f679b851fe5b272ce17c70632ff4beb5b35ab64bc706b2485af.pk.ygg/pkg
composer require guzzlehttp/guzzle:6.0.0
← 6.0.15.3.0 →