Archive::HAR::Writer - Interface for writing HTTP Archive (HAR) files.
version 0.01
use Archive::HAR::Writer;
my $har = Archive::HAR::Writer->new;
$har->add_http_transaction([$request, $response]);
$har->write_file('archive.har');
This class builds a HTTP Archive (HAR) 1.2 document out of a series of HTTP transactions, and writes it out as JSON to a file, file handle, or string.
apiAPI level to use. Defaults to 1. If breaking changes are made to the API, this value can be used to control which version is used.
$har->add_http_transaction($transaction); $har->add_http_transaction([$request, $response]);
Add the HTTP transaction to the archive. $transaction should be one of:
A Mojolicious HTTP transaction object.
[$request, $response]An array reference containing a request and response object.
The $request must be a HTTP::Request and the $response must be a HTTP::Response.
Other classes may be supported in the future.
$har->write_file($filename);
Write the HAR archive to a file.
$har->write($fh); $har->write(\$string);
Write the HAR archive to a file handle or string reference.
Graham Ollis <plicease@cpan.org>
This software is copyright (c) 2026 by Graham Ollis.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.