卷发错误:无法连接到splynx.skytrendnetworks.com端口443:没有到主机的路线
我的API在Postman中运行完美,但是当我提取代码并尝试在本地运行它或在我的服务器中运行时,我会得到此错误curl错误:无法连接到splynx.skytrendnetworks.com port 443:没有通往主机<的路由< /代码>下面是我的代码,任何帮助将不胜感激
<?php
$url = 'https://splynx.skytrendnetworks.com/api/2.0/admin/customers/customer';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://splynx.skytrendnetworks.com/api/2.0/admin/customers/customer',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Splynx-EA (key=79 1349da848ee7b1b2faf2cbf8&nonce=28&signature=2A2E6A0AEC50D48C8DAEAvCA8862929681D3678D5B9)',
'Content-Type: application/json'
),
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
if(curl_exec($curl) === false)
{
echo 'Curl error: ' . curl_error($curl);
}
else
{
echo $response;
echo 'Operation completed without any errors';
}
curl_close($curl);
My API is running perfectly in Postman but when I extract the code and try to run It locally or in my Server I get this Error Curl error: Failed to connect to splynx.skytrendnetworks.com port 443: No route to host
below is my Code any Help will be appreciated
<?php
$url = 'https://splynx.skytrendnetworks.com/api/2.0/admin/customers/customer';
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://splynx.skytrendnetworks.com/api/2.0/admin/customers/customer',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Splynx-EA (key=79 1349da848ee7b1b2faf2cbf8&nonce=28&signature=2A2E6A0AEC50D48C8DAEAvCA8862929681D3678D5B9)',
'Content-Type: application/json'
),
));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($curl);
if(curl_exec($curl) === false)
{
echo 'Curl error: ' . curl_error($curl);
}
else
{
echo $response;
echo 'Operation completed without any errors';
}
curl_close($curl);
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论