1 package Business::BatchPayment::Transport::HTTPS;
5 Sends a request by HTTPS POST, and downloads the response the same way.
6 Options are 'server', 'port', 'get_path', 'put_path', optionally
13 use Net::HTTPS::Any 0.10;
14 with 'Business::BatchPayment::Transport';
16 has [ qw( host port get_path put_path ) ] => (
21 has 'content_type' => (
24 default => '', # application/x-www-form-urlencoded
35 debug => ($self->debug > 3 ? 1 : 0),
36 'Content-Type' => $self->content_type
38 if (ref $content and ref $content eq 'HASH') {
39 $post{'args'} = $content;
41 $post{'content'} = $content;
44 warn "starting https_post...\n" if $self->debug;
45 my ( $page, $response, %reply_headers ) = Net::HTTPS::Any::https_post(%post);
47 warn "PAGE:\n$page\n\nRESPONSE:\n$response\n\n" if $self->debug >= 2;
48 return ($page, $response, %reply_headers);
54 $self->https_post($self->put_path, $content);
58 # will probably need to be overridden in most cases
60 my ($page, $response, %reply_headers) = $self->https_post($self->get_path);
64 __PACKAGE__->meta->make_immutable;