kadamwhite/wordpress-rest-api — pull request #77 by kadamwhite (2014-09-11 06:51:52+00:00)
Title: Implement pagination parsing for collection responses (ref #76)

This implementation follows the structure outlined in the discussion of #76: parse the header information, and use it to augment the response collection. The presence or absence of `._paging` can therefore be used to quickly assess whether the response collection is complete, or just one page's worth.

I ended up not taking the approach of implementing this as a drop-in method to mutate the response data, as I needed pagination handling now and we have more discussion to do before we go forward with the response collection augmentation interface. There was also a question of whether that interface would be exposed pre-returnBody, or after it; if we went with the latter, there would be no way to access header information.

We've opened a conversation with @rmccue about how Pagination may evolve within the ReST API plugin; this solution will evolve along with the plugin itself, at least up until the API hits core.