Hey! I need some help with displaying the content of headers. Is there a simple way to do this? Here's my code snippet:
this.http.post(this.url, '{"username":"user","password":"123456"}')
.subscribe((res) => {
var payload = res.json();
var headers = res.headers;
console.log('Content-Range: ' + headers.values());
However, I'm encountering an error:
ERROR Object { _body: error, status: 0, ok: false, statusText: "", headers: Object, type: 3, url: null }
==================================UPDATE================================ I am attempting to make a post request to a server, but it seems that Angular throws an error right after http.post due to an empty body. As such, I cannot perform a console log. I am only interested in the headers and not the body.