title: How to get string response of fetch api and assign it to a variable?
body: <p>I am sending a request to backend with fetchApi and <strong>the response is coming as a just only string (not in a json body)</strong></p>
  <p>Here is my frontend code:</p>
  <pre><code>        async decryptText() {
      let response = await this.getDecryptedText(this.entry.text, this.user.userId)
      if(response){
          console.log(response)
      }
     }
          
  async getDecryptedText(inputText: string, userId: number) {
      let url = &quot;http://localhost:8080/getDecryptedText?textToDecrypt=&quot; + inputText + &quot;&amp;userId=&quot; + userId;
      return fetch(url);
    }
  </code></pre>
  <p>But I cannot parse the response like other json responses because it is just a string.</p>
  <p>When I print it to console the output is this:
  <a href="https://i.stack.imgur.com/rSGJW.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rSGJW.png" alt="enter image description here" /></a></p>
  <p>I just want to print on to console the response string</p>
  <p>How can I get the string response and assign it to a variable ?</p>
  <p>I have edited the code as on answers.</p>