title: How do i convert Axios to Fetch effectively?
body: <p>I'm trying to implement microsoft translation API. (<a href="https://rapidapi.com/microsoft-azure-org-microsoft-cognitive-services/api/microsoft-translator-text" rel="nofollow noreferrer">https://rapidapi.com/microsoft-azure-org-microsoft-cognitive-services/api/microsoft-translator-text</a>) <br>
  I want to integrate it with dialog flow and dialog flow doesn't work with axios function so i tried using async function using fetch. <br><br></p>
  <p>This code is working fine</p>
  <pre><code>axios({
     &quot;method&quot;: &quot;POST&quot;,
     &quot;url&quot;: &quot;https://microsoft-translator-text.p.rapidapi.com/translate&quot;,
     &quot;headers&quot;: {
        &quot;content-type&quot;: &quot;application/json&quot;,
        &quot;x-rapidapi-host&quot;: &quot;microsoft-translator-text.p.rapidapi.com&quot;,
        &quot;x-rapidapi-key&quot;: &quot;key&quot;,
        &quot;accept&quot;: &quot;application/json&quot;,
        &quot;useQueryString&quot;: true
     }, &quot;params&quot;: {
        &quot;profanityAction&quot;: &quot;NoAction&quot;,
        &quot;textType&quot;: &quot;plain&quot;,
        &quot;to&quot;: &quot;hi&quot;,
        &quot;api-version&quot;: &quot;3.0&quot;
     }, &quot;data&quot;: [{
        &quot;Text&quot;: &quot;Hello, World&quot;
     }]
  })
     .then((response) =&gt; {
        console.log(response);
        console.log(response.data[0].detectedLanguage.language);
        console.log(response.data[0].translations[0].text);
     })
     .catch((error) =&gt; {
        console.log(error);
     })
  </code></pre>
  <p><br><br></p>
  <p>But when I use the same code using fetch, its giving the error</p>
  <pre><code>async function translate() {
     const response = await fetch(`https://microsoft-translator-text.p.rapidapi.com/translate`, {
        &quot;method&quot;: &quot;POST&quot;,
        &quot;headers&quot;: {
           &quot;content-type&quot;: &quot;application/json&quot;,
           &quot;x-rapidapi-host&quot;: &quot;microsoft-translator-text.p.rapidapi.com&quot;,
           &quot;x-rapidapi-key&quot;: &quot;key&quot;,
           &quot;accept&quot;: &quot;application/json&quot;,
           &quot;useQueryString&quot;: true
        }, &quot;params&quot;: {
           &quot;profanityAction&quot;: &quot;NoAction&quot;,
           &quot;textType&quot;: &quot;plain&quot;,
           &quot;to&quot;: &quot;hi&quot;,
           &quot;api-version&quot;: &quot;3.0&quot;
        }, &quot;data&quot;: [{
           &quot;Text&quot;: &quot;Hello, World&quot;
        }]
     });
     const jsonres = await response.json();
     console.log(jsonres);
  }
  translate();
  </code></pre>
  <br>
  <p>This is the error</p>
  <pre><code>error:
  code: 400000
  message: &quot;One of the request inputs is not valid.&quot;
  </code></pre>