Php CodeIgniter Rest服务器集成

Php CodeIgniter Rest服务器集成,php,codeigniter,rest,codeigniter-restserver,Php,Codeigniter,Rest,Codeigniter Restserver,我已经从github下载了CodeIgniter Rest服务器源代码 我已经按照自述文件进行了集成,但是当我调用like时,我得到了一个“无效API密钥”错误和403禁止错误htttp://www.sitename.com:81/api/key/index 生成第一次新密钥并存储到数据库中 截图1: 下面是my Rest.php中的代码>>>> <?php defined('BASEPATH') OR exit('No direct script access allowed'); $

我已经从github下载了CodeIgniter Rest服务器源代码

我已经按照自述文件进行了集成,但是当我调用like时,我得到了一个“无效API密钥”错误和403禁止错误htttp://www.sitename.com:81/api/key/index 生成第一次新密钥并存储到数据库中

截图1:

下面是my Rest.php中的代码>>>>

<?php 
defined('BASEPATH') OR exit('No direct script access allowed');
$config['force_https'] = FALSE;
$config['rest_default_format'] = 'json';
$config['rest_supported_formats'] = ['json','array','csv','html','jsonp','php','serialized','xml'];
$config['rest_status_field_name'] = 'status';
$config['rest_message_field_name'] = 'error';
$config['enable_emulate_request'] = TRUE;
$config['rest_realm'] = 'REST API';
$config['rest_auth'] = FALSE;
$config['auth_source'] = ''; //i set it as none/blank, default value set as 'ldap'
$config['auth_library_class'] = '';
$config['auth_library_function'] = '';
$config['rest_valid_logins'] = ['admin' => '1234'];
$config['rest_ip_whitelist_enabled'] = FALSE;
$config['rest_ip_whitelist'] = '';
$config['rest_ip_blacklist_enabled'] = FALSE;
$config['rest_ip_blacklist'] = '';
$config['rest_database_group'] = 'default';
$config['rest_keys_table'] = 'keys';
$config['rest_enable_keys'] = TRUE; //i set it as TRUE default value is FALSE
$config['rest_key_column'] = 'key';
$config['rest_limits_method'] = 'ROUTED_URL';
$config['rest_key_length'] = 40;
$config['rest_key_name'] = 'X-API-KEY';
$config['rest_enable_logging'] = TRUE;//i set it as TRUE default value is FALSE
$config['rest_logs_table'] = 'logs';
$config['rest_enable_access'] = FALSE;
$config['rest_access_table'] = 'access';
$config['rest_logs_json_params'] = FALSE;
$config['rest_enable_limits'] = FALSE;
$config['rest_limits_table'] = 'limits';
$config['rest_ignore_http_accept'] = FALSE;
$config['rest_ajax_only'] = FALSE;
$config['rest_language'] = 'english';
是否有人可以指导我如何为CI rest服务器生成此首次密钥


如果有人能尽快给出这个问题的解决方案,这将非常有帮助,因为我从找到解决方案的两天起就一直试图解决这个问题,但没有取得任何成功(

来自该图书馆的回购文件:

//By default, the HTTP will be X-API-KEY. This can be configured in config/rest.php.
$ curl -X POST -H "X-API-KEY: some_key_here" http://example.com/books
//By default, the HTTP will be X-API-KEY. This can be configured in config/rest.php.
$ curl -X POST -H "X-API-KEY: some_key_here" http://example.com/books