卷发错误:无法连接到splynx.skytrendnetworks.com端口443:没有到主机的路线

发布于 2025-02-04 11:19:53 字数 1384 浏览 3 评论 0原文

我的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文