From 9e158fac8e2541a16db50009f9f4aecf42dcba5d Mon Sep 17 00:00:00 2001 From: franck cuny Date: Wed, 6 Jan 2010 13:46:22 +0100 Subject: return deserialized content and http response --- lib/MooseX/Net/API.pm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'lib/MooseX') diff --git a/lib/MooseX/Net/API.pm b/lib/MooseX/Net/API.pm index 9b1d0fe..defbe2c 100644 --- a/lib/MooseX/Net/API.pm +++ b/lib/MooseX/Net/API.pm @@ -242,7 +242,14 @@ sub net_api_method { @deserialize_order ); } - return $content if ( $res->is_success ); + if ( $res->is_success ) { + if (wantarray) { + return ( $content, $res ); + } + else { + return $content; + } + } die MooseX::Net::API::Error->new( http_error => $res, -- cgit 1.4.1