Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/owox/artaxdumper
Dump Artax requests and responses for logging and debugging
https://github.com/owox/artaxdumper
artax curl debugging dump logging
Last synced: about 1 month ago
JSON representation
Dump Artax requests and responses for logging and debugging
- Host: GitHub
- URL: https://github.com/owox/artaxdumper
- Owner: OWOX
- License: mit
- Created: 2018-11-13T22:33:00.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-11-25T22:30:18.000Z (about 6 years ago)
- Last Synced: 2024-11-17T03:12:42.741Z (about 1 month ago)
- Topics: artax, curl, debugging, dump, logging
- Language: PHP
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ArtaxDumper - dump [Artax](https://github.com/amphp/artax) requests and responses for logging and debugging
[![Build Status](https://travis-ci.com/OWOX/ArtaxDumper.svg?branch=master)](https://travis-ci.com/Sevavietl/ArtaxDumper)
[![Coverage Status](https://coveralls.io/repos/github/OWOX/ArtaxDumper/badge.svg?branch=master)](https://coveralls.io/github/OWOX/ArtaxDumper?branch=master)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PHPStan](https://img.shields.io/badge/PHPStan-enabled-brightgreen.svg?style=flat)](https://github.com/phpstan/phpstan)Install it with:
```bash
composer require owox/artax-dumper
```Only [curl](https://curl.haxx.se/) request dumper hugely inspired by [cuzzle](https://github.com/namshi/cuzzle) available for now. It can be used for copy/paste requests logging:
```php
\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"
});
```