This commit adds support for making authenticated requests using the OAuth2 header token, if :oauth_token is supplied in the options map.
Add support for making OAuth2 requests
I am still not entirely sure of the best way to handle exceptional things. Some API calls that are predicates catch 404 exceptions and return false. This breaks those (though it is simple enough to fix). We also have the problem of "if we aren't throwing exceptions, then what are we doing?". I think that Github API requests return a JSON body for 404s and the like, so we might be okay leaving it just the way it is. If not, we'll have to do special things in safe-parse. I hope I'm right and it does, because returning a map is a thousand times better than throwing an exception and it certainly means less work.
I'll check this stuff out asap (tomorrow night at the latest) and pull this request. I appreciate contribution. I wasn't aware that it would be this easy to add oauth2 support. Furthermore, thanks for sneaking that little :throw-exceptions key in there. I had been putting off thinking about this problem for a bit too long. ;)
I actually didn't intend for the ":throw-exceptions false" to make it into the commit, I added it as a debug statement to figure out what was going on. Feel free to remove it, or I can make another commit to remove it.
Thanks for the quick response.
No, it's fine. I've been needing to address error handling anyways, like I said. I'm going to go ahead and merge.