[eluser]Unknown[/eluser]
Hey everyone,
New to rest services, and having a bit of an issue. I'm trying get a list of states from a pre developed api and I'm not getting a response. Below is my code.
Code:
<?php
class Test_spark extends CI_Controller
{
function index()
{
$this->load->spark('restclient/2.0.0');
$this->load->library('rest');
$this->rest->initialize(array(
'server' => 'https://domain.com/v1/',
'http_user' => 'username',
'http_pass' => 'password',
'http_auth' => 'basic'
));
// get the states
$states = $this->rest->get('states');
echo $states;
}
}
This is the print out of debug.
Code:
=============================================
REST Test
=============================================
Request
https://domain.com/v1/states
=============================================
Response
No response
=============================================
Call details
Array
(
[url] => https://domain.com/v1/states
[content_type] =>
[http_code] => 0
[header_size] => 0
[request_size] => 0
[filetime] => -1
[ssl_verify_result] => 0
[redirect_count] => 0
[total_time] => 0.759726
[namelookup_time] => 0.727306
[connect_time] => 0.759777
[pretransfer_time] => 0
[size_upload] => 0
[size_download] => 0
[speed_download] => 0
[speed_upload] => 0
[download_content_length] => -1
[upload_content_length] => -1
[starttransfer_time] => 0
[redirect_time] => 0
[certinfo] => Array
(
)
[redirect_url] =>
)