I tried to make an http request like so:

    const httpOptions = {
      observe: 'body' as 'body',
      responseType: 'text' as 'text'
    };

This gave me this error in typeScript / Angular:

error TS2769: No overload matches this call.

Solution

You have to cast httpOptions to Object. 

const httpOptions : Object = {
      headers: new HttpHeaders({
        'Accept': 'text/html',
        'Content-Type': 'text/plain; charset=utf-8'
      }),
      responseType: 'text'
    };

 

 

Saved you some valuable time?

Buy me a drink 🍺