:
=over 4
=item * JSON
=item * XML
=item * YAML
=item * HTML
=back
=cut
sub format {
my $self = shift;
if (@_) {
my $new = shift;
if ( $new !~ /^JSON|XML|YAML|HTML$/ )
rp "Invalid format. Must be one of JSON, XML, YAML, or HTML.";
return;
}
$self->{format} = $new;
}
return $self->{format} || "JSON";
}
=item mime_type
This return
carp "format() needs to be set";
return;
}
return "application/json" if $self->format eq "JSON";
return "text/xml" if $self->format eq "XML";
return "application/
ts (as a hash ref) of:
=over 4
=item * format => $format
The valid format of the mssage, eithe JSON, YAML, XML, or HTML.
=item * content => $content
The decoded content from the HTTP response.
=
d $args{request_time};
if ( $args{format} eq "JSON" ) {
require JSON;
JSON->import('decode_json');
my $hash = decode_json( $args{content} );
$self->job_id( $hash->