Permalink
Browse files

Fix URL

  • Loading branch information...
1 parent 5e50e55 commit a37876e0c54b4ea5f6a1809775e8675a85c6445e @marcusramberg committed Jun 20, 2010
Showing with 10 additions and 3 deletions.
  1. +3 −2 lib/WebService/PutIo.pm
  2. +7 −1 t/03live.t
View
@@ -22,9 +22,10 @@ sub request {
api_secret => $self->api_secret,
params => \%params
};
- my $url=Mojo::URL->new(base=>'http://api.put.io/v1/')
- ->fragment($method)
+ my $url=Mojo::URL->new('http://api.put.io/')
+ ->path("/v1/$class/$method")
->query(method=>$method);
+ warn("result: $url");
my $tx=$self->client->post_form( $url => $data );
if (my $res=$tx->success) {
return WebService::PutIo::Result->new( res=> { request => $self->json->encode($data) } );
View
@@ -3,5 +3,11 @@ plan skip_all => 'This test requires PUT_IO_API_KEY and PUT_IO_SECRET'
unless $ENV{PUT_IO_API_KEY} && $ENV{PUT_IO_API_SECRET};
plan tests => 1;
+use WebService::PutIo;
+
my $put_io=WebService::PutIo->new(api_key=>$ENV{PUT_IO_API_KEY}, api_secret => $ENV{PUT_IO_API_SECRET});
-isa_ok($put_io,'WebService::PutIo');
+isa_ok($put_io,'WebService::PutIo');
+
+# Basic Request
+my $res=$put_io->request('messages','list');
+isa_ok($res,'WebService::PutIo::Result');

0 comments on commit a37876e

Please sign in to comment.