title: How to access formdata response in angular
body: <p><strong>Component.ts</strong>  </p>
  
  <pre><code> upload() {
        var formData: any = new FormData();
        formData.append('file', this.name);
        this.http.post('/temp/upload', formData,{responseType: 'text' })
          .subscribe((response) =&gt; {
               console.log('response received is ', response);
               if(response.code==400){
      alert("Upload success")
      }
      else{
      alert("Upload failed")
      }
  
        });}
  </code></pre>
  
  <p><strong>server.js</strong>    </p>
  
  <pre><code> //upload
      router.post('/upload){
      if(!error){
         res.send({
               code: 400,
               success: "Upload success"
                });
      else{
      res.send({
      code:200
      }}
      }
  </code></pre>
  
  <p><strong>The above upload function returns code:400 on success, The problem is I'm able to access "Property 'code' does not exist on type 'string'"</strong></p>
  
  <p><strong>Thanks in advance</strong></p>