-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
Option to use meta data from headers #197
Comments
Hi @DylanGuedes ! I'm not too sure how you'd do this, but it's outside of the scope of Ember Infinity - Ember Data doesn't let headers get back to the App code. I'd instead take a look at the serializer for your model, and perhaps "transform" the headers from the response into an entry on the model collection's |
i had a similar issue and here was my solution for future googlers. place this in the corresponding adapter and you are good to go.
now a word to the wise as a follow up. these 'custom headers' you will be using for ember infinity will not appear as visible 'headers' by default. you will need to have your backend response header allow for it in order for ember to see them. in the case of the snippet posted above the response header also should also include see this for details: |
+1 to @edprats solution - I've actually used that in the past :) |
Hi,
I'm trying to consume an API that maintains meta-data like 'totalPages', 'currentPage', 'totalEntries' via the response header, instead of the response body. Any possibility to also work on headers? :/
The text was updated successfully, but these errors were encountered: