NAME

WWW::VastAI::Role::HTTP - Shared synchronous HTTP client role for Vast.ai API consumers

VERSION

version 0.001

DESCRIPTION

This role provides the low-level HTTP functionality used by WWW::VastAI. It handles bearer authentication, JSON encoding/decoding, pluggable IO backends, and uniform error handling.

REQUIRED ATTRIBUTES

  • api_key

  • base_url

METHODS

get

my $data = $client->get('/instances/');

Performs a GET request.

post

my $data = $client->post('/bundles/', \%body);

Performs a POST request with a JSON body.

put

my $data = $client->put('/instances/123/', \%body);

Performs a PUT request with a JSON body.

delete

my $data = $client->delete('/instances/123/');
my $data = $client->delete('/template/', { id => 123 });

Performs a DELETE request. Vast.ai uses both path-only and JSON-body delete styles, so an optional body is supported.

SEE ALSO

WWW::VastAI, WWW::VastAI::Role::IO, WWW::VastAI::LWPIO

SUPPORT

Issues

Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-vastai/issues.

IRC

Join #kubernetes on irc.perl.org or message Getty directly.

CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

AUTHOR

Torsten Raudssus <torsten@raudssus.de>

COPYRIGHT AND LICENSE

This software is copyright (c) 2026 by Torsten Raudssus <torsten@raudssus.de> https://raudssus.de/.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.