Issue
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?
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)
Answered By - Zerotwelve
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.