- # accept a hashref or a list (keep it ordered)
- my $post_data;
- if ( ref($_[0]) eq 'HASH' ) {
- $post_data = shift;
- } elsif ( scalar(@_) > 1 ) {
- tie my %hash, 'Tie::IxHash', @_;
- $post_data = \%hash;
- } elsif ( scalar(@_) == 1 ) {
- $post_data = shift;
- } else {
- die "https_get called with no params\n";
- }
-
- $opts->{"Content-Type"} ||= "application/x-www-form-urlencoded";
-
- ### XXX referer!!!
- my %headers;
- if ( ref( $opts->{headers} ) eq "HASH" ) {
- %headers = %{ $opts->{headers} };
- }
- $headers{'Host'} ||= $self->server;
-
- my $path = $self->path;
- if ( keys %$post_data ) {
-
- #my $u = URI->new("", "https");
- #$u->query_param(%$post_data);
- #$path .= '?'. $u->query;
-
- $path .= '?'. join('&',
- map { uri_escape($_).'='. uri_escape($post_data->{$_}) }
- keys %$post_data
- );
- #warn $path;
-
- }