NAME
WWW::Bund::Role::Response - Role for typed API response objects
VERSION
version 0.001
SYNOPSIS
package WWW::Bund::Response::MyFormat;
use Moo;
with 'WWW::Bund::Role::Response';
has data => (is => 'lazy');
sub _build_data {
my ($self) = @_;
# Parse $self->content
return $parsed_data;
}
DESCRIPTION
Role for response parser classes. Consumes raw HTTP response content and provides parsed data.
Implementations:
WWW::Bund::Response::JSON - Parses JSON to Perl data structures
WWW::Bund::Response::XML - Parses XML to HashRef via XML::Twig
WWW::Bund::Response::Raw - Returns content as-is
content
Raw response content (character string). Defaults to empty string.
content_type
Content-Type header value. Defaults to empty string.
REQUIRED ATTRIBUTES
data
Parsed response data. Must be implemented by consuming classes.
Typically lazy-built from content.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/Getty/p5-www-bund/issues.
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.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.