sevavietl / artax-dumper
此包已被废弃,不再维护。作者建议使用 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: 2022-02-01 13:15:10 UTC
README
安装方法
composer require owox/artax-dumper
仅通过 curl 请求转储器,深受 cuzzle 启发,目前可用。可用于记录复制/粘贴请求。
\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" });