title: Not getting result data using meteor http package
body: <p>I am trying to retrieve data from a server by making an api call using the Meteor http package. I have written the api call inside a method on the server side. On the client, I am doing <code>Meteor.call()</code> to the method on server. The issue is, am not getting the desired JSON data in meteor, whereas when testing the URL in browser am getting the data.</p>
  
  <p>I have checked on other posts in stack, but they didn't workout. Please help me out why result is not getting properly.</p>
  
  <pre><code> // on server
  
      'get_list' : function () {
  
          var url = "http://10.10.2.48/api/content?type=apartment"; //this is a dummy url due to security reasons.
  
          Meteor.http.get(url,function(error, result){
              console.log(result);
              return result;
          });
      }
  </code></pre>
  
  <p>I am getting 406 error with the 'GET' call. Below is the result of it.</p>
  
  <pre><code>{ statusCode: 406,
      content: '',
      headers: 
      { 
          date: 'Wed, 26 Mar 2014 06:50:53 GMT',
          server: 'Apache/2.2.22 (Debian)',
          'x-powered-by': 'PHP/5.4.4-14+deb7u7',
          expires: 'Sun, 19 Nov 1978 05:00:00 GMT',
         'last-modified': 'Wed, 26 Mar 2014 06:50:53 +0000',
         'cache-control': 'no-cache, must-revalidate, post-check=0, pre-check=0',
         etag: '"1395816653"',
         vary: 'Accept,Accept-Encoding',
         'content-length': '0',
         'keep-alive': 'timeout=5, max=100',
         'connection: 'Keep-Alive',
         'content-type': 'text/html' 
      },
      data: null 
  }
  </code></pre>
  
  <p>I have also tried 'POST' call but getting 404 error. Below is the result of it.</p>
  
  <pre><code> { statusCode: 404,
          content: '',
          headers: 
          { 
              date: 'Wed, 26 Mar 2014 06:50:53 GMT',
              server: 'Apache/2.2.22 (Debian)',
              'x-powered-by': 'PHP/5.4.4-14+deb7u7',
              expires: 'Sun, 19 Nov 1978 05:00:00 GMT',
             'last-modified': 'Wed, 26 Mar 2014 06:50:53 +0000',
             'cache-control': 'no-cache, must-revalidate, post-check=0, pre-check=0',
             etag: '"1395816653"',
             vary: 'Accept-Encoding',
             'content-length': '0',
             'keep-alive': 'timeout=5, max=100',
             'connection: 'Keep-Alive',
             'content-type': 'text/html' 
          },
          data: null 
      }
  </code></pre>
  
  <p>When I tried the synchronous call on server, I am getting "Internal Server Error" on client side. On server console, I am getting the following error.</p>
  
  <pre><code>Exception while invoking method 'get_list' Error: failed [406]
      at Object.Future.wait (/root/.meteor/tools/bebd881297/lib/node_modules/fibers/future.js:326:15)
      at Object.call (packages/meteor/helpers.js:111)
          at Object.HTTP.get (packages/http/httpcall_common.js:73)
      at Meteor.methods.get_prop_list (app/server/main.js:567:36)
      at maybeAuditArgumentChecks (packages/livedata/livedata_server.js:1346)
      at packages/livedata/livedata_server.js:539
      at _.extend.withValue (packages/meteor/dynamics_nodejs.js:35)
      at packages/livedata/livedata_server.js:538
      at _.extend.withValue (packages/meteor/dynamics_nodejs.js:35)
      at _.extend.protocol_handlers.method (packages/livedata/livedata_server.js:537)
           - - - - -
      at makeErrorByStatus (packages/http/httpcall_common.js:12)
      at Request._callback (packages/http/httpcall_server.js:99)
      at Request.self.callback (/root/.meteor/tools/bebd881297/lib/node_modules/request/request.js:129:22)
      at Request.EventEmitter.emit (events.js:98:17)
      at Request.&lt;anonymous&gt; (/root/.meteor/tools/bebd881297/lib/node_modules/request/request.js:873:14)
      at Request.EventEmitter.emit (events.js:117:20)
      at IncomingMessage.&lt;anonymous&gt; (/root/.meteor/tools/bebd881297/lib/node_modules/request/request.js:824:12)
      at IncomingMessage.EventEmitter.emit (events.js:117:20)
      at _stream_readable.js:920:16
      at process._tickCallback (node.js:415:13)
  </code></pre>