PHP code example of osadchyi-s / incoming-curl

1. Go to this page and download the library: Download osadchyi-s/incoming-curl library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

osadchyi-s / incoming-curl example snippets

 php
$curlLine = IncomingCurl::makeCurlFromGlobals();
 php
$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();