summary refs log tree commit diff
path: root/lib/Net
diff options
context:
space:
mode:
authorMainframe2008 <thg.bot@gmail.com>2013-01-30 20:30:53 +0100
committerMainframe2008 <thg.bot@gmail.com>2013-01-30 20:30:53 +0100
commit83e75f1aad3522c877eab5a73f1ac03426e67c22 (patch)
tree129138df3a78f700fa26cc32b90e7ede1c172469 /lib/Net
parentMerge pull request #18 from sukria/master (diff)
downloadnet-riak-83e75f1aad3522c877eab5a73f1ac03426e67c22.tar.gz
Update lib/Net/Riak/Role/REST.pm
Diffstat (limited to 'lib/Net')
-rw-r--r--lib/Net/Riak/Role/REST.pm39
1 files changed, 38 insertions, 1 deletions
diff --git a/lib/Net/Riak/Role/REST.pm b/lib/Net/Riak/Role/REST.pm
index 261d573..92ea3ae 100644
--- a/lib/Net/Riak/Role/REST.pm
+++ b/lib/Net/Riak/Role/REST.pm
@@ -1,4 +1,7 @@
 package Net::Riak::Role::REST;
+{
+  $Net::Riak::Role::REST::VERSION = '0.1600';
+}
 
 # ABSTRACT: role for REST operations
 
@@ -8,6 +11,7 @@ use Moose::Role;
 use MooseX::Types::Moose 'Bool';
 use Net::Riak::Types qw/HTTPResponse HTTPRequest/;
 use Data::Dump 'pp';
+use Data::Dumper;
 with qw/Net::Riak::Role::REST::Bucket 
     Net::Riak::Role::REST::Object 
     Net::Riak::Role::REST::Link
@@ -35,6 +39,12 @@ has disable_return_body => (
     default => 0
 );
 
+has ssl => (
+    is => 'rw',
+	isa => Bool,
+	default => 0
+);
+
 sub _build_path {
     my ($self, $path) = @_;
     $path = join('/', @$path);
@@ -44,6 +54,7 @@ sub _build_uri {
     my ($self, $path, $params) = @_;
 
     my $uri = URI->new($self->get_host);
+    if ( $uri =~ /^https:.+/ ) { $self->ssl(1); }
     $uri->path($self->_build_path($path));
     $uri->query_form(%$params);
     $uri;
@@ -61,8 +72,9 @@ sub send_request {
     my ($self, $req) = @_;
 
     $self->http_request($req);
+    
     my $r = $self->useragent->request($req);
-
+	
     $self->http_response($r);
 
     if ($ENV{RIAK_VERBOSE}) {
@@ -99,3 +111,28 @@ sub stats {
 }
 
 1;
+
+__END__
+=pod
+
+=head1 NAME
+
+Net::Riak::Role::REST - role for REST operations
+
+=head1 VERSION
+
+version 0.1600
+
+=head1 AUTHOR
+
+franck cuny <franck@lumberjaph.net>, robin edwards <robin.ge@gmail.com>
+
+=head1 COPYRIGHT AND LICENSE
+
+This software is copyright (c) 2011 by linkfluence.
+
+This is free software; you can redistribute it and/or modify it under
+the same terms as the Perl 5 programming language system itself.
+
+=cut
+