I was using Angular Http
module before and the method res.json()
used to work fine.
I have recently tried HttpClient
but then the
Right, that's because new http client by default calls res.json()
implicitly and you don't need to that manually yourself. Here is the quote from commit:
JSON is an assumed default and no longer needs to be explicitly parsed
See Difference between HTTP and HTTPClient in angular 4? for more details.
As HttpClient itself adds res.json(), which means it implicitly calls this function due to which, it is worthless to call it explicitly or manually. So there is no need to add this function. Hope this works, thanx...