PHP code example of juanchosl / curlclient

1. Go to this page and download the library: Download juanchosl/curlclient 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/ */

    

juanchosl / curlclient example snippets


use JuanchoSL\CurlClient\CurlRequest;

$extra_headers = ['Content-type' => 'application/json'];

$curl = new CurlRequest();
$curl->setSsl(true);
$response = $curl->post($url, json_encode([$key => $value]), $extra_headers);

$http_code = $response->getResponseCode();
$body = $response->getBody();