title: how to get data from a http request with firebase cloud functions?
body: <p>I create a firebase function, in the cloud the stuff exists, in the code i return this stuff but wehen i try get the data in a http request don't charge anything.
  This is my Function in firebase functions:</p>
  
  <pre class="lang-js prettyprint-override"><code>exports.autentifyuser = functions.https.onRequest((req, res) =&gt; {
      var stuff = [];
      var db = admin.firestore();
      const key=req.query.ids;
  
      db.collection("/usuariosdinny/").where("key","==",key).get().then(snapshot =&gt; {
  
          snapshot.forEach(doc =&gt; {
              var newelement = {
                  "id": doc.id,
                  "nombre": doc.data().nombre,
                  "foto": doc.data().foto,
                  "descripcion":doc.data().descripcion,
                  "edad":doc.data().edad,
                  "key":doc.data().key,
                  "sexo":doc.data().sexo,
                  "telefono":doc.data().telefono,
                  "tipo":doc.data().tipo
              }
              stuff = stuff.concat(newelement);
          });
          console.log(stuff);
          res.send(stuff);
          return stuff;
      }).catch(reason =&gt; {
          res.send(reason);
  
          console.log(reason);
          return reason;
      })
  });
  </code></pre>
  
  <p>this is the call: </p>
  
  <pre class="lang-js prettyprint-override"><code>let params: URLSearchParams = new URLSearchParams();
    params.set('ids',this.ids);
    let requestOptions = new RequestOptions();
    requestOptions.search = params;
    this.http.get('https://us-central1-dinnyud-9b9c8.cloudfunctions.net/autentifyuser',requestOptions).toPromise().then(response=&gt;console.log(response.json()) &amp;&amp; this.navCtrl.push(TabsControllerPage) &amp;&amp; loader.dismiss())
    .catch(error=&gt;alert2.present()&amp;&amp; loader.dismiss());
  </code></pre>
  
  <p>I need the <code>response.json()</code> and get the "Tipo" data. Thanks for your help.</p>