Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get Response Headers #1

Open
satyasutar opened this issue Mar 12, 2018 · 1 comment
Open

Get Response Headers #1

satyasutar opened this issue Mar 12, 2018 · 1 comment

Comments

@satyasutar
Copy link

Hello,
I have a query, rather than an issue.

Like HttpClient has the option to observe the full response instead of content only.
http .get<MyJsonData>('/data.json', {observe: 'response'}) .subscribe(resp => { // Here, resp is of type HttpResponse<MyJsonData>. // You can inspect its headers: console.log(resp.headers.get('X-Custom-Header')); // And access the body directly, which is typed as MyJsonData as requested. console.log(resp.body.someField); });

Is there an option to read the reponse header using angular-rest-client?

@steven166
Copy link
Owner

Hi,
That is currently not possible, but it is easy to add. I'll make a pr.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants