def fib(n):
if n <= 1:
return n
else:
print(n)
return fib(n-1)+fib(n-2)
<?php
$composer = __DIR__ . '/../vendor/autoload.php';
if(!file_exists($composer))
{
throw new \Exception('Composer not found in: ' . $composer);
}
require_once $composer;
$client = new GuzzleHttp\Client(['verify' => false]);
try {
$result = $client->get('https://10.128.128.8:5007/esic/api', ['query' => ['proc' => 'sd.get_tracking_status', 'item_key' => '3636614', 'iin' => '910131451122'],'auth' => [
'admin_site',
'password'
]]);
$userContent = simplexml_load_string($result->getBody()->getContents(), "SimpleXMLElement", LIBXML_NOCDATA);
var_dump($userContent);
} catch (\Exception $e) {
echo $e->getRequest() . "\n";
if ($e->hasResponse()) {
echo $e->getResponse() . "\n";
}
else{
echo "Пустой ответ";
}
}
GET /esic/api?proc=sd.get_tracking_status&item_key=3636614&iin=910131451122 HTTP/1.1 Host: 10.128.128.8:5007 User-Agent: Guzzle/5.3.1 curl/7.29.0 PHP/5.4.16 Authorization: Basic c3lzX3NpdGU6REZXMXk1dSo5NWpoa2syNEZHaA== Пустой ответ
<?php
$composer = __DIR__ . '/../vendor/autoload.php';
if(!file_exists($composer))
{
throw new \Exception('Composer not found in: ' . $composer);
}
require_once $composer;
$client = new GuzzleHttp\Client(['verify' => false]);
try {
$client->get('https://10.128.128.8:5007/esic/api', ['query' => ['proc' => 'sd.get_tracking_status', 'item_key' => '3636614', 'iin' => '910131451122'],'auth' => [
'admin_site',
'password'
]]);
} catch (\Exception $e) {
echo $e->getRequest() . "\n";
if ($e->hasResponse()) {
echo $e->getResponse() . "\n";
}
}