title: CodeIgniter Rest Client
body: <p>I am trying to access json product response and want to render it on page.
  When I hit url</p>
  
  <pre><code>http://api-product.skimlinks.com/query?q=merchant%3A(Amazon%20OR%20Newegg)&amp;key=hide&amp;format=json
  </code></pre>
  
  <p>it returns response with follwing structure.</p>
  
  <pre><code>-ProductsAPI{
     status: 200,
     products: [
          - {
             merchant: "Newegg",
             id:"111",
      ......
      ......
  </code></pre>
  
  <p>To run it on codeigniter, installed <a href="https://github.com/philsturgeon/codeigniter-restclient" rel="nofollow">rest_client</a> with the help of 'Spark'. It is installed properly and runs fine.<br/>
  <strong>Question:</strong><br/><br/> 
  But how to get request for above given url? Code is  </p>
  
  <pre><code>function index() {
      $this-&gt;load-&gt;spark('restclient/2.1.0');
      $this-&gt;rest-&gt;initialize(array('server' =&gt; 'http://api-product.skimlinks.com/query?q=merchant%3A(Amazon%20OR%20Newegg)&amp;key=hide&amp;format=json'));
      $this-&gt;rest-&gt;option(CURLOPT_SSL_VERIFYPEER, FALSE);
      $data['products'] = $this-&gt;rest-&gt;get();
      $this-&gt;load-&gt;view('index',$data);
  }
  </code></pre>
  
  <p>Not sure what to put in <code>$this-&gt;rest-&gt;get()</code> method? Key and format?</p>