You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You may have figured it out by now, but to answer your question:
xhr in this case is the browser default return value for an XMLHttpRequest instance. This is returned by calling view.collection.fetch(). In order to retrieve headers from an XHR instance, you need to call xhr.getAllResponseHeaders() (or xhr.getResponseHeader(header) to get a specific header.)
However, more conveniently, in your success callback, the last argument, the response object, has those headers pre-populated for you. So in order to access the count header you could do this:
i'm having an issue getting a header in ampersand-rest-collection success callback after updating to v5.0.0.
http://cl.ly/image/011Y1q1Y3s1g
The text was updated successfully, but these errors were encountered: