Since blobs can be any arbitrary binary data, the input and responses for the blob api takes an encoding parameter that can be either utf-8 or base64. If your data cannot be losslessly sent as a UTF-8 string, you can base64 encode it.
Create a blob
@param [Hash] params @input params [String] :content
String of content.
@input params [String] :encoding
String containing encoding<tt>utf-8</tt> or <tt>base64</tt>
@examples
github = Github.new github.git_data.blobs.create 'user-name', 'repo-name', content: "Content of the blob", encoding: "utf-8"
@api public
# File lib/github_api/client/git_data/blobs.rb, line 40 def create(*args) arguments(args, required: [:user, :repo]) do permit VALID_BLOB_PARAM_NAMES assert_required VALID_BLOB_PARAM_NAMES end post_request("/repos/#{arguments.user}/#{arguments.repo}/git/blobs", arguments.params) end
Get a blob
@example
github = Github.new github.git_data.blobs.get 'user-name', 'repo-name', 'sha'
@api public
# File lib/github_api/client/git_data/blobs.rb, line 18 def get(*args) arguments(args, required: [:user, :repo, :sha]) get_request("/repos/#{arguments.user}/#{arguments.repo}/git/blobs/#{arguments.sha}", arguments.params) end
Generated with the Darkfish Rdoc Generator 2.