Pithub::GitData::Blobs(3pm)

Pithub::GitData::Blobs3pm

Github v3 git data blobs api

Version

version 0.01043

Overview

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.

Methods

create

•

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

•

Get a Blob

    GET /repos/:user/:repo/git/blobs/:sha

Parameters:

•

user: mandatory string

•

repo: mandatory string

•

sha: mandatory string

Examples:

    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"
    }

Releases

6 releases since Debian 8 (Jessie); the text changed 5 times.

  1. 8
  2. 9
  3. 10
  4. 11
  5. 12
  6. 13

Author

Johannes Plunien <[email protected]>

From libpithub-perl 0.01043-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.