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?
CodePudding user response:
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)