<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl('http://ya.ru'); $resp = $curl->request()->getResponse(); echo $resp;
<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl(); $resp = $curl->setCurl('/opt/cprocsp/bin/curl')->request('https://icrs.nbki.ru/products/B2BRequestServlet')->getResponse(); echo $resp;
<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl(); $resp = $curl->setCurl('/opt/cprocsp/bin/curl')->setHeaders(array('content-type' => 'application/octet-stream;charset="windows-1251"'))->request('https://icrs.nbki.ru/products/B2BRequestServlet')->getResponse(); echo $resp;
<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl('https://icrs.nbki.ru/products/B2BRequestServlet'); $common = $curl->setCurl('/opt/cprocsp/bin/curl')->setHeaders(array('Content-Type' => 'text/xml'))->sendFile(__DIR__ . '/nbci.nbci'); echo $common->getCmd(); echo $common->request()->getResponse();
<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl('http://ya.ru'); $resp = $curl->setUserAgent('Mozilla/3.0 (Win95; I)')->getCmd(); echo $resp;
<?php require __DIR__ . '/../vendor/autoload.php'; use efureev\CustomCurl; $curl = new CustomCurl('https://api.telegram.org/bot{token}/sendMessage'); $bodyMsg = ['chat_id' => '@TestBot', 'text' => 'Test']; $json = json_encode($bodyMsg); $common = $curl->setHeaders(['Content-Type' => 'application/json'])->setBody($json); // or setJson($bodyMsg) echo $common->getCmd() . PHP_EOL; echo $common->post()->getResponse();