pengwynn/octokit — pull request #97 by ctshryock (2012-06-07 03:07:11+00:00)
Title: Add support for creating downloads

:warning: __Feedback Needed__

The specs pass, but this doesn't actually work yet. Creating a download is a [two part process][2], the first part of which is simple enough. For the second part, I stubbed a `POST` call the the S3 url and created the hash for the body, and then implemented the method in `downloads.rb` to `POST` to that same URL. From what I can tell though in [connection.rb lines 10-15][1] we essentially force all requests to go to github.com. That said, I'm confused why the "should post to a S3 url" spec passes.

In irb I've confirmed part one works. I `rake install` and run through it in irb, and although calling `create_download` does create a download on GitHub's site, I get a "false" response in irb and clicking on the created download from the Web UI gives a "file not found" message, so the post to S3 part is obviously failing.

So the two things here:
- I'm planning on replacing [line 42][3] of `downloads.rb` with a plain Faraday POST to the S3 url instead of our `post` shortcut. Is that a bad idea?
- Why does that spec pass

Any feedback or guidance would be much appreciated.

[1]: https://github.com/pengwynn/octokit/blob/master/lib/octokit/connection.rb#L10-15
[2]: http://developer.github.com/v3/repos/downloads/#create-a-new-download-part-1-create-the-resource
[3]: https://github.com/ctshryock/octokit/blob/downloads/lib/octokit/client/downloads.rb#L42