octokit/octokit.net — pull request #649 by Haacked (2014-12-31 02:30:57+00:00)
Title: Repository Contents API

This incorporates and supersedes #434

I took a slightly different approach. In the interest of keeping close to the API, there's only one method called `GetContents` that maps to the ["Get contents" API](https://developer.github.com/v3/repos/contents/#get-contents). I was able to accomplish this by changing the serializer a bit. When it's trying to deserialize a JSON object into an `IEnumerable` but the JSON text is clearly a `T` and not an array, I simply deserialize the one object, add it to a list, and return that.

The other bit I had to do is when creating content, the text of the content needs to be base64 encoded. Also, when requesting content, the data is base64 encoded. So I changed the serializer to handle this transparently by simply applying the `SerializeAsBase64` attribute. So the consumer of the client doesn't have to worry about this.