mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-05 04:52:47 +02:00
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
This commit is contained in:
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user