owox / artax-dumper
v0.0.3
2018-11-25 22:24 UTC
Requires
- php: >=7.1
- amphp/artax: ^3.0
Requires (Dev)
- owox/phpspec-amp: ^0.0.2
- php-coveralls/php-coveralls: ^2.1
- phpspec/phpspec: ^5.1
- phpstan/phpstan: ^0.10.5
- phpunit/phpunit: ^7.4
This package is not auto-updated.
Last update: 2024-05-08 07:46:20 UTC
README
Install it with:
composer require owox/artax-dumper
Only curl request dumper hugely inspired by cuzzle available for now. It can be used for copy/paste requests logging:
\Amp\Loop::run(static function () { $curlRequestDumper = new \ArtaxDumper\Request\CurlRequestDumper(); // GET Request $request = new \Amp\Artax\Request('https://httpbin.org/get'); $curl = yield $curlRequestDumper->dump($request); // => curl "https://httpbin.org/get" // POST Request $request = (new \Amp\Artax\Request($uri = 'https://httpbin.org/post', 'POST')) ->withBody($body = 'foo=bar'); $curl = yield $curlRequestDumper->dump($request); // => curl -d "foo=bar" "https://httpbin.org/post" });