Пример #1
0
<?php

require __DIR__ . '/../vendor/autoload.php';
use efureev\CustomCurl;
$curl = new CustomCurl('http://ya.ru');
$resp = $curl->request()->getResponse();
echo $resp;
Пример #2
0
<?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;
Пример #3
0
<?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;
Пример #4
0
<?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();
Пример #5
0
<?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;
Пример #6
0
<?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();