title: Codeigniter: Consume RESTful service
body: <p>Is there an easy to setup Codeigniter REST library which I can use to consume a RESTful service? I tried setting up <a href="https://github.com/philsturgeon/codeigniter-restclient" rel="nofollow">this</a> library. But could not set up <code>Spark</code>. Tried following steps:</p>
  
  <ol>
  <li>Adding a directory named sparks in the root of your codeigniter directory</li>
  <li>Adding a custom Loader Class to application/core/MY_Loader.php.</li>
  </ol>
  
  <p>It gave me another error <code>Cannot find spark path at sparks/curl/1.2.1/</code>. Now I am stuck. Wondering why  it is so hard to setup RESTful API in codeigniter.</p>
  
  <p><strong>Update:</strong> When I try to run</p>
  
  <pre><code>$this-&gt;load-&gt;spark('restclient/2.1.0');
          // Load the library
          $this-&gt;load-&gt;library('rest');
          // Run some setup
          $this-&gt;rest-&gt;initialize(array('server' =&gt; 'http://api.twitter.com/'));
          // Pull in an array of tweets
          $tweets = $this-&gt;rest-&gt;get('1/statuses/user_timeline.json?include_entities=true&amp;include_rts=true&amp;screen_name=jenksuy&amp;count=2');
          $tweetobjects = json_decode($tweets);
          foreach ($tweetobjects['results'] as $tweet) {
              log_message('info', $tweet['text']);
          }
  </code></pre>
  
  <p>I am getting <code>Error: Call to undefined method CI_Loader::spark()</code></p>