title: Unable to get the value sent by the Cloud Functions for Firebase response.send method
body: <p>I use React.js and axios.</p>
  
  <p><code>firebase emulators:start --only functions</code><br>
  The emulator returns a normal value when you send a request to the URI, but if you use React to display the returned value, you will see an HTML tag.</p>
  
  <p>Could you tell me how to use the values returned by Cloud Functions in React?<br>
  What have I misunderstood?</p>
  
  <hr>
  
  <p>Here's the code</p>
  
  <p><strong>Cloud Functions</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>export const resKeyword = functions.https.onRequest(async (req, res) =&gt; {
    const keyword = req.query.keyword;
    res.send({ keyword: keyword });
  });
  </code></pre>
  
  <p><strong>React.js</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>const getJSON = async (value) =&gt; {
    const { data } = await axios.get("/keyword", {
      params: { keyword: value },
    });
    console.log(data);
  };
  </code></pre>
  
  <hr>
  
  <p>Emulator results<br>
  <a href="https://i.stack.imgur.com/0az6v.png" rel="nofollow noreferrer">Emulator results</a></p>
  
  <pre><code>{ "keyword":"test" }
  </code></pre>
  
  <p>Console.log<br>
  <a href="https://i.stack.imgur.com/ivW3m.jpg" rel="nofollow noreferrer">Console.log</a></p>
  
  <pre><code>&lt;!doctype html&gt;&lt;html lang="en"&gt;&lt;head&gt;&lt;meta charset="utf-8"/&gt;
  ...
  ...
  &lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <hr>
  
  <h1>Add</h1>
  
  <p>I created a demo based on the code I wrote in the question, and it worked without any problems(why).<br>
  So I prepared a demo that generated the same error as my production environment.</p>
  
  <p><a href="https://github.com/C-V-Alkan/test" rel="nofollow noreferrer">Repository(GitHub)</a></p>
  
  <p>The differences from the code in question are as follows.</p>
  
  <ul>
  <li>Get the URL of the GIF from <a href="https://developers.giphy.com/docs/api#quick-start-guide" rel="nofollow noreferrer">Giphy</a></li>
  <li>Use Typescirpt</li>
  </ul>
  
  <p>The results returned by the demo's emulator are as follows.<br>
  endpoint: <code>http://localhost:5001/test-a3f76/us-central1/resGifs?keyword=test</code><br>
  <a href="https://i.stack.imgur.com/970MO.png" rel="nofollow noreferrer">Emulator results</a></p>
  
  <p>The result of the console will be the same HTML tag.<br>
  <a href="https://i.stack.imgur.com/ivW3m.jpg" rel="nofollow noreferrer">Console.log</a></p>