title: ERROR SyntaxError: Unexpected token < in JSON at position 0 at JSON.parse (<anonymous>) in angular 6 application
body: <p>I have searched about it in google, Yes I understood that am receiving <code>context/type:text/html</code> not <code>application/json</code>,but I didn't get how to solve this issue. when I trying to hit the api of third party user from my local server , am getting this error. Please check the screenshot of this error. </p>
  
  <p><a href="https://i.stack.imgur.com/paC2v.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/paC2v.png" alt="enter image description here"></a>                 </p>
  
  <p><a href="https://i.stack.imgur.com/L8vJH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/L8vJH.png" alt="enter image description here"></a></p>
  
  <p>service.ts</p>
  
  <pre><code>    export class VamosysService {
      constructor(private _http:Http){}
  
      getVechicalLocations():Observable&lt;any[]&gt;{
           return this._http.get(API_URL)
                           .pipe(map((response:Response)=&lt;any[]&gt;response.json()));
  
  }
  </code></pre>
  
  <p>component.ts</p>
  
  <pre><code>export class VamosysComponent implements OnInit {
  
    vechicalLocation:any[];
  
    constructor(private _vamoService:VamosysService) { }
    ngOnInit() {
    this._vamoService.getVechicalLocations()
                          .subscribe((data) =&gt; this.vechicalLocation = data);
    }
  
  
  
  }
  </code></pre>
  
  <p>Thanks in advance</p>