1. Go to this page and download the library: Download svyatov/curlwrapper 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/ */
$response = $curl->get('google.com?q=test');
$response = $curl->get('google.com?q=test', array('some_variable' => 'some_value'));
// CurlWrapper will append '&some_variable=some_value' to the url
$response = $curl->post('test.com/posts', array('title' => 'Test', 'body' => 'This is a test'));
$response = $curl->rawPost($url, $jsonData);
$response = $curl->rawPut($url, 'raw random data');
$curl->addHeader('Content-Type', 'text/plain');
// or
$curl->addHeader('Content-Type', 'application/json');
// and then
$response = $curl->rawPost($url, $jsonData);
$info = $curl->getTransferInfo();
$httpCode = $curl->getTransferInfo('http_code');
$curl->setCookieFile('some_file_name.txt');
$curl->setReferer('http://google.com');
$curl->setUserAgent('some user agent string');
$curl->setTimeout(15); // seconds
$curl->setFollowRedirects(true); // to follow redirects