kadamwhite/wordpress-rest-api — pull request #54 by kadamwhite (2014-06-30 09:09:48+00:00)
Title: Add wp.root() method to query custom endpoints

This is the first stab at defining behavior for #51; it's a little early to be adding this sort of behavior, but given that this library is unstable I feel that iterating on the idea quickly while it's top of mind will give us the best long-term results.

Usage for `wp.root`:

Create a basic `WPRequest` which, if submitted with `.get()`, would send a GET request to the URI `http://my.website.com/wp-json/custom/endpoint`:
```javascript
var wp = new WP({ endpoint: 'http://my.website.com/wp-json' });
var request = wp.root( 'custom/endpoint' );
```
Create a `request` with all of the filtering methods of `CollectionRequest`, which would send a GET to `http://another-website.com/api/collection/endpoint`:
```javascript
var wp = new WP({ 'http://another-website.com/api' });
var request = wp.root( 'collection/endpoint', true );
```

I am open to bikeshedding this syntax, but let's keep more theoretical discussion about how we want to handle custom endpoints long-term over in #51.