osadchyi-s/incoming-curl

Make curl command line from incoming request

0.1.0 2016-10-30 17:03 UTC

This package is auto-updated.

Last update: 2024-09-20 01:38:05 UTC


README

Latest Version Total Downloads

This package for creating curl command line from incoming request data.

Install

Via Composer

$ composer require osadchyi-s/incoming-curl

Usage

Make current incoming curl from global data

$curlLine = IncomingCurl::makeCurlFromGlobals();

Make curl from custom data

$IC = new IncomingCurl();
$IC->setUrl('http://example');
$IC->setBody(json_encode(['test'=>1]));
$IC->setHeaders([
    [
        'Content-Type'=> ['appliation/json']
    ]
]);
$IC->setMethod('GET');

$curlLine = $IC->makeCurlCommandLine();

Credits

License

The GPL3 License. Please see License File for more information.