projects
/
Net-HTTPS-Any.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
11c117d
)
fix GET/POST args as hash
author
ivan
<ivan>
Mon, 16 Jun 2008 19:13:36 +0000
(19:13 +0000)
committer
ivan
<ivan>
Mon, 16 Jun 2008 19:13:36 +0000
(19:13 +0000)
lib/Net/HTTPS/Any.pm
patch
|
blob
|
history
diff --git
a/lib/Net/HTTPS/Any.pm
b/lib/Net/HTTPS/Any.pm
index
1812d06
..
d0ef929
100644
(file)
--- a/
lib/Net/HTTPS/Any.pm
+++ b/
lib/Net/HTTPS/Any.pm
@@
-82,7
+82,8
@@
our $VERSION = '0.09';
=head1 DESCRIPTION
This is a simple wrapper around either of the two available SSL
=head1 DESCRIPTION
This is a simple wrapper around either of the two available SSL
-modules.
+modules. It offers a unified API for send GET and POST requests over HTTPS
+and receiving responses.
It depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ).
It depends on Net::SSLeay _or_ ( Crypt::SSLeay and LWP::UserAgent ).
@@
-131,14
+132,14
@@
sub https_get {
# accept a hashref or a list (keep it ordered)
my $post_data = {};
if ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'HASH' ) {
# accept a hashref or a list (keep it ordered)
my $post_data = {};
if ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'HASH' ) {
- $post_data =
shift
;
+ $post_data =
$opts->{'args'}
;
} elsif ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'ARRAY' ) {
tie my %hash, 'Tie::IxHash', @{ $opts->{'args'} };
$post_data = \%hash;
}
$opts->{'port'} ||= 443;
} elsif ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'ARRAY' ) {
tie my %hash, 'Tie::IxHash', @{ $opts->{'args'} };
$post_data = \%hash;
}
$opts->{'port'} ||= 443;
- $opts->{"Content-Type"} ||= "application/x-www-form-urlencoded";
+
#
$opts->{"Content-Type"} ||= "application/x-www-form-urlencoded";
### XXX referer!!!
my %headers = ();
### XXX referer!!!
my %headers = ();
@@
-246,7
+247,7
@@
sub https_post {
# accept a hashref or a list (keep it ordered). or a scalar of content.
my $post_data = '';
if ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'HASH' ) {
# accept a hashref or a list (keep it ordered). or a scalar of content.
my $post_data = '';
if ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'HASH' ) {
- $post_data =
shift
;
+ $post_data =
$opts->{'args'}
;
} elsif ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'ARRAY' ) {
tie my %hash, 'Tie::IxHash', @{ $opts->{'args'} };
$post_data = \%hash;
} elsif ( exists($opts->{'args'}) && ref($opts->{'args'}) eq 'ARRAY' ) {
tie my %hash, 'Tie::IxHash', @{ $opts->{'args'} };
$post_data = \%hash;