createBlob method

Future<GitBlob> createBlob(
  1. RepositorySlug slug,
  2. CreateGitBlob blob
)

Creates a blob with specified blob content.

API docs: https://developer.github.com/v3/git/blobs/#create-a-blob

Implementation

Future<GitBlob> createBlob(RepositorySlug slug, CreateGitBlob blob) {
  return github.postJSON(
    '/repos/${slug.fullName}/git/blobs',
    convert: GitBlob.fromJson,
    statusCode: StatusCodes.CREATED,
    body: GitHubJson.encode(blob),
  );
}