Get response header after post

Hello I am using


for my request, and I want to access the value of header after I request
This is the provider I write:

post(url, parm) {
		return new Promise(resolve => {, parm)
				.map(res => res)
				.subscribe(data => {
				}, error => {
					error.message = "fail";

15 AM
This is the result but I don’t know how to get the value of “access-token”
can you guild me the ways.

All methods should type their parameters and their return value. Except in extraordinary circumstances, you should not be explicitly instantiating Promises. I consider it a design flaw to initiate and subscribe to an Observable in the same function. map(res => res) is meaningless and should go away. Please post textual data as text, not images. If you can resolve these issues, maybe we can make some more progress.

1 Like

Never let a great Observable go to waste by subscribing too early or even worse, convert to a promise.

And if you insist on doing so, use the toPromise() operator.

1 Like