Pithub::GitData::Blobs - Github v3 Git Data Blobs API
version 0.01030
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.
utf-8
base64
Create a Blob
POST /repos/:user/:repo/git/blobs
Parameters:
user: mandatory string
repo: mandatory string
data: mandatory hashref, having following keys:
content: mandatory string
encoding: mandatory string, utf-8 or base64
Examples:
my $b = Pithub::GitData::Blobs->new; my $result = $b->create( user => 'plu', repo => 'Pithub', data => { content => 'Content of the blob', encoding => 'utf-8', } );
Response: Status: 201 Created
{ "sha": "3a0f86fb8db8eea7ccbb9a95f325ddbedfb25e15" }
Get a Blob
GET /repos/:user/:repo/git/blobs/:sha
sha: mandatory string
my $b = Pithub::GitData::Blobs->new; my $result = $b->get( user => 'plu', repo => 'Pithub', sha => 'b7cdea6830e128bc16c2b75efd99842d971666e2', );
Response: Status: 200 OK
{ "content": "Content of the blob", "encoding": "utf-8" }
Johannes Plunien <plu@cpan.org>
This software is copyright (c) 2011 by Johannes Plunien.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Pithub::GitData::Blobs, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Pithub::GitData::Blobs
CPAN shell
perl -MCPAN -e shell install Pithub::GitData::Blobs
For more information on module installation, please visit the detailed CPAN module installation guide.