my $o = OvhApi->new(type => OvhApi::OVH_API_EU, applicationKey => $KEY[0], applicationSecret => $KEY[1], consumerKey => $KEY[2]);
my $URL = shift @ARGV or help();
+my $BODY = @ARGV ? shift @ARGV : '';
# NB 14.12.16 use LWP::Simple;
# NB 14.12.16 if ($URL eq '/help') {
# NB 14.12.16 die LWP::Simple::get('https://eu.api.ovh.com/console/');
# NB 14.12.16 }
#my $URL = @ARGV == 1 ? shift @ARGV : join('/',map{uri_escape($_)} @ARGV);
-my $response = $o->get(path=>$URL,method=>$Opt{method});
+
+$BODY = -e $BODY ? JSON::decode_json(`cat $BODY`) : JSON::encode_json($BODY) if $BODY;
+#use Data::Dumper; die Dumper($BODY);
+my $response = $o->rawCall(path=>$URL,method=>$Opt{method},body=>$BODY);
if (!$response) {
die "$NAME: $URL failed!"
=head1 OPTIONS
option[activate=s] [KEY] Activate a key (first bit before ":" or KEY[0])
- option[method|m] Method (default: GET)
+ option[method|m=s] Method (default: GET)
option[verbose|v+] Verbose mode: increase the verbosity level.
option[debug+] Debug mode: increase the verbosity level.
option[version|V] Print version (default: $VERSION)