duanjiu1003 2019-08-19 07:32
浏览 108

如何使用codeIgniter获取其他网站的内容并将其显示在我的网站中?

Process.php

            <?php
            defined('BASEPATH') OR exit('No direct script access allowed');

            class Process extends CI_Controller {

                public function index()
                {
                    $this->load->view('process');
                    //echo "test";
                }   
            }

process.php

            <?php
            $curl = curl_init();
            $auth_data = array(
                'client_id'         => '30b5f5beeccfba1dbcb31941523d5e3b',
                'client_secret'     => ' ', 
                'grant_type'        => 'client_credentials'
            );

            curl_setopt($curl, CURLOPT_POST, 1);
            curl_setopt($curl, CURLOPT_POSTFIELDS, $auth_data);
            curl_setopt($curl, CURLOPT_URL, 'https://authentication.skimapis.com/access_token'); //https://www.geeksforgeeks.org/
            curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

            $result = curl_exec($curl);
            if(!$result){die("Connection Failure");}
            echo $result;
            curl_close($curl);

            ?>

****Browser view**** 415 Unsupported Media Type The server does not support the media type transmitted in the request. How to solve this issue

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求解 yolo算法问题
    • ¥15 虚拟机打包apk出现错误
    • ¥30 最小化遗憾贪心算法上界
    • ¥15 用visual studi code完成html页面
    • ¥15 聚类分析或者python进行数据分析
    • ¥15 三菱伺服电机按启动按钮有使能但不动作
    • ¥15 js,页面2返回页面1时定位进入的设备
    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝