title: Angular 6: HttpErrorResponse SyntaxError: Unexpected token s in JSON
body: <p>I am posting a request and I am suppose to receive a 'success' string back as response. I am getting an HttpResponseError with the following information posted in the image below. </p>
  
  <p><a href="https://i.stack.imgur.com/VswWx.png" rel="noreferrer"><img src="https://i.stack.imgur.com/VswWx.png" alt="enter image description here"></a></p>
  
  <p>PurchaseOrderService</p>
  
  <pre><code>postPurchaseOrderCustom(purchaseOrderCustom: PurchaseOrderSaveCustom) {
   const url = `${this.localUrl}purchaseOrderCustom`;
   return this.http.post&lt;String&gt;(url, purchaseOrderCustom, {headers: this.header})
              .pipe(
                     catchError(this.handleError('postPurchaseOrderCustom', 'I am an error'))
                   );
    }
  </code></pre>
  
  <p>PurchaseOrderComponent </p>
  
  <pre><code>this.purchaseOrderService.postPurchaseOrderCustom(purchaseOrderCustom).subscribe( response =&gt; {
    console.log("Testing", response);
    },
    error =&gt; {
      console.error('errorMsg',error );   
    }
  </code></pre>
  
  <p>The way I am doing it is the same way its done in the documentation. Do point out to me what I am doing wrong.</p>
  
  <p><a href="https://i.stack.imgur.com/PQr1g.png" rel="noreferrer"><img src="https://i.stack.imgur.com/PQr1g.png" alt="error shown when I implement answer provided by @Muhammed"></a></p>