sigmavirus24/github3.py — pull request #219 by bgilbert (2014-04-08 18:25:20+00:00)
Title: Add method for downloading release assets

GitHub's [API for downloading release assets](https://developer.github.com/v3/repos/releases/#get-a-single-release-asset) is a bit odd: the client does a `GET` on the asset's API endpoint, passing `Accept: application/octet-stream`. The response may or may not redirect to Amazon S3, but if it does, the redirected request will fail unless the client strips the `Authorization` and `Content-Type` request headers.

Add an `Asset.download()` method to handle all this, with an API similar to `Repository.archive()`. Also add an `Asset.download_url` attribute mirroring the private `_api` attribute.