मैं अपने समाधान के लिए CodeIgniter RESTClient और RESTServer पुस्तकालय स्थापित करने की कोशिश कर रहा हूं। (philsturgeon-codeigniter-restclient और chriskacerguis-codeigniter-restserver)।कोडनिर्देशक restclient काम नहीं कर रहा
मैं बाकी सर्वर को चलाने और चलाने में कामयाब रहा, लेकिन मुझे बाकी क्लाइंट के साथ समस्याएं आ रही हैं।
- कॉपी Rest.php फ़ाइल (GitHub से डाउनलोड) है और यह डाल में पुस्तकालयों फ़ोल्डर
- डाउनलोड Curl library और डाल दिया:
ये आ जहां मैं अब कर रहा हूँ करने के लिए कदम मैंने किया हैं पुस्तकालयों में
- Rest.php में कोड संशोधित
$this->_ci->load->library('curl');
uncomment (यदि मैं इस फ़ाइल मैं निम्नलिखित संदेश मिल में कर्ल पुस्तकालय के उपयोगों पर होवर):
CI_Controller में नहीं मिलाफील्ड 'कर्ल'
मैं एक नया नियंत्रक "Restclient" कहा जाता है मेरी एपीआई परीक्षण करने के लिए पैदा करते हैं। इस नियंत्रक में मैं निम्न विधि बनाया:
function rest_client_example($id) { $this->load->library('rest', array( 'server' => 'localhost/codeigniter/api/users/' )); $user = $this->rest->get('volunteer', array('id' => $id), 'json'); var_dump($user); }
ब्राउज़िंग http://localhost/codeigniter/api/restclient/rest_client_example/25 को तो मुझे
D:\wamp\www\codeigniter\application\controllers\api\Restclient.php:36:null
देता है निम्नलिखित कोड को क्रियान्वित करने से ऊपर के बजाय, मैं एक सही परिणाम मिलता है:
$this->load->library('curl');
$t = $this->curl->simple_get('api/users/volunteer', array('id'=>$id));
var_dump($t);
तो मुझे पता है कि कर्ल काम कर रहा है।
मेरा अनुमान है कि मैं कर्ल लाइब्रेरी के लोडिंग के साथ कुछ गलत कर रहा हूं?
क्या आप '$ autoload [ 'पुस्तकालयों'] = सरणी ('कर्ल', 'बाकी') करते हैं,' 'autoload.php' में – jagad89