Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Get full response in angular with observe: 'response' with other settings

It works

return this.http.post(url, data, {observe: 'response'})

But for some reason it doesn’t

let options = {
  headers: new HttpHeaders().set('Content-Type', "application/json"),
  withCredentials: true,
  observe: 'response'
}
return this.http.post(url, data, options)

Why and how i can use observe: ‘response’ in this case?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

you should tell exactly what’s not working. I guess the typescript compiler is complaining about the type.

You can solve this like this: return this.http.post(url, data, options as any)

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading