title: Use Github API with rest client to create a file
body: <p>I'm trying to use the Github API to create a file in a repo.</p>
  
  <p>This CURL command does exactly what I want to do:</p>
  
  <p><code>curl -X PUT -H 'Authorization: token &lt;TOKEN&gt;' -d '{"path": "test.txt", "message": "Test Commit", "committer": {"name": "Kevin Clark", "email": "kevin@kevinclark.ca"}, "content": "bXkgbmV3IGZpbGUgY29udGVudHM="}' https://api.github.com/repos/vernalkick/kevinclark/contents/test.txt</code></p>
  
  <p>I need to do the same request but using rest_client in ruby, but this returns a 404:</p>
  
  <pre><code>require 'rest_client'
  
  params = {
    :path =&gt; "test.txt",
    :message =&gt; "Test Commit",
    :committer =&gt; {
      :name =&gt; "Kevin Clark",
      :email =&gt; "kevin@kevinclark.ca"
    },
    :content =&gt; "bXkgbmV3IGZpbGUgY29udGVudHM=",
    :access_token =&gt; &lt;TOKEN&gt;
  }
  
  RestClient.put "https://api.github.com/repos/vernalkick/kevinclark/contents/test.txt", :params =&gt; params
  </code></pre>
  
  <p>Github's documentation: <a href="https://developer.github.com/v3/repos/contents/" rel="nofollow">https://developer.github.com/v3/repos/contents/</a></p>