Created
January 23, 2018 18:41
-
-
Save kelunik/4debe50bdb72085f533bbe33a4d9ef7d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require __DIR__ . "/vendor/autoload.php"; | |
use Amp\Promise; | |
$client = new Http\Adapter\Artax\Client; | |
$request1 = new GuzzleHttp\Psr7\Request("GET", "http://example.com/"); | |
print $client->sendAsyncRequest($request1) | |
->then(function ($response) { | |
return $response->withStatus(523); | |
}) | |
->wait()->getStatusCode() . PHP_EOL; |
Apart from a missing );
, yeah.
PHP Fatal error: Uncaught Http\Client\Exception\TransferException: Bad reponse returned in /home/kelunik/GitHub/php-http/artax-adapter/src/Internal/Promise.php:50
But just looked at the interface, seems like it doesn't have to behave like that and we could fix it?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try: