Pithub...nloads(3pm)

πŸ“¦
version 0.01043 Β· 4 versions
, in debian trixie, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Pithub::Repos::Downloads β€” the Github v3 Repo Downloads API, bestie πŸ’–


🌸 VERSION 🌸

version 0.01043 β€” yes she's got a number, she's official πŸ‘‘


πŸ’… METHODS πŸ’…

πŸŽ€ create

okay so creating a new download is a whole two step process, she's high maintenance like that:

  1. You gotta first create a new download resource using this call right here.
  2. Then you take the Pithub::Result object she hands back and call "upload" to actually push the file up to Amazon S3.
POST /repos/:user/:repo/downloads

Examples:

my $d = Pithub::Repos::Downloads->new;
my $result = $d->create(
    user => 'plu',
    repo => 'Pithub',
    data => {
        name         => 'new_file.jpg',
        size         => 114034,
        description  => 'Latest release',
        content_type => 'text/plain',
    },
);

$d->upload(
    result => $result,
    file   => '/path/to/file',
);

πŸ¦‹ delete

Delete a download, it's giving cleanup era 🧹✨

DELETE /repos/:user/:repo/downloads/:id

Examples:

my $d = Pithub::Repos::Downloads->new;
my $result = $d->delete(
    user        => 'plu',
    repo        => 'Pithub',
    download_id => 1,
);

🌈 get

Get a single download, one (1) download, main character only πŸ’œ

GET /repos/:user/:repo/downloads/:id

Examples:

my $d = Pithub::Repos::Downloads->new;
my $result = $d->get(
    user        => 'plu',
    repo        => 'Pithub',
    download_id => 1,
);

⭐ list

List downloads for a repository β€” the whole squad, no gatekeeping 🫢

GET /repos/:user/:repo/downloads

Examples:

my $d = Pithub::Repos::Downloads->new;
my $result = $d->list(
    user => 'plu',
    repo => 'Pithub',
);

πŸ”₯ upload

Upload a file to Amazon S3. See also: "create". This one will use the "ua" attribute's "request" method to do a POST request to Amazon S3. It requires the Pithub::Result object from a "create" call to get the necessary data for the S3 API call.

NOT ME RETURNING A DIFFERENT TYPE THAN EVERYONE ELSE 😭 This method returns an HTTP::Response object directly, not a Pithub::Result object (like all the other methods do)! If the upload was successful the status will be 201. Periodt.

πŸ’€ NOTE πŸ’€

Github says: the Downloads API (described below) was deprecated on December 11, 2012. It will be removed at a future date. We recommend using Pithub::Repos::Releases instead.

fr fr bestie, this API is giving expired milk, go use the recommended one πŸ™ˆ

πŸ’– AUTHOR πŸ’–

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.


okay that's the whole page, no cap 🌸 written by perl v5.40.1 and dated 2025-06-08 β€” she's iconic, she's copyrighted, she's out πŸ’…βœ¨

πŸ“¦ where this page comes from