aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorplegall <plg@piwigo.org>2008-09-04 22:08:47 +0000
committerplegall <plg@piwigo.org>2008-09-04 22:08:47 +0000
commit255a4f393a8de4e5cbc133f9d56ed68c2cbf6068 (patch)
tree22651f754bdb7b168b2e45b50f78e4cf7aee0148 /tools
parent57dd0ffcb65ed472540492a0a03409e375dec298 (diff)
improvement: remote client summarizes HTTP response when invoking
pwg.images.add => code, message. git-svn-id: http://piwigo.org/svn/trunk@2500 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'tools')
-rw-r--r--tools/piwigo_remote.pl20
1 files changed, 19 insertions, 1 deletions
diff --git a/tools/piwigo_remote.pl b/tools/piwigo_remote.pl
index 8cdd1da35..89597ed65 100644
--- a/tools/piwigo_remote.pl
+++ b/tools/piwigo_remote.pl
@@ -64,10 +64,28 @@ if ($opt{action} eq 'pwg.images.add') {
name => $opt{name},
};
- $result = $ua->post(
+ my $response = $ua->post(
$conf{base_url}.'/ws.php?partner='.$conf{partner_key}.'&format=json',
$form
);
+
+ print "-" x 50, "\n";
+ printf("response code : %u\n", $response->code);
+ printf("response message : %s\n", $response->message);
+ print "-" x 50, "\n";
+ print "\n";
+
+# use Data::Dumper;
+# print Dumper($response);
+
+ if ($response->is_success) {
+ print "upload successful\n";
+ }
+ else {
+ warn 'A problem has occured during upload', "\n";
+ warn $response->decoded_content, "\n";
+ die $response->status_line;
+ }
}
if ($opt{action} eq 'pwg.tags.list') {