Changeset 2500 for trunk/tools


Ignore:
Timestamp:
Sep 5, 2008, 12:08:47 AM (16 years ago)
Author:
plg
Message:

improvement: remote client summarizes HTTP response when invoking
pwg.images.add => code, message.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/piwigo_remote.pl

    r2463 r2500  
    6565    };
    6666
    67     $result = $ua->post(
     67    my $response = $ua->post(
    6868        $conf{base_url}.'/ws.php?partner='.$conf{partner_key}.'&format=json',
    6969        $form
    7070    );
     71
     72    print "-" x 50, "\n";
     73    printf("response code    : %u\n", $response->code);
     74    printf("response message : %s\n", $response->message);
     75    print "-" x 50, "\n";
     76    print "\n";
     77
     78#     use Data::Dumper;
     79#     print Dumper($response);
     80
     81    if ($response->is_success) {
     82        print "upload successful\n";
     83    }
     84    else {
     85        warn 'A problem has occured during upload', "\n";
     86        warn $response->decoded_content, "\n";
     87        die $response->status_line;
     88    }
    7189}
    7290
Note: See TracChangeset for help on using the changeset viewer.