--method paramter to make post, put, and delete calls (get is default)
and --params to pass in a JSON string of parameters
getsy --sandbox --path '/listings/51455722' --params '{"title" : "chang
:Getsy::OAuth;
use File::HomeDir qw(home);
use File::Spec::Functions qw(catfile);
use JSON::XS;
use MooseX::Getopt;
use MooseX::Types::Moose qw/Str HashRef/;
use WWW::Getsy::Ty
hod decode(Str $json) {
decode_json $json;
}
method encode(HashRef $json) {
JSON::XS->new->utf8->pretty->encode($json);
}
method pretty_print(Str $json) {
pri
ecret
RequestParams
RequestMethod
)];
use MooseX::Types::Moose qw/Str HashRef/;
use JSON::XS;
use MooseX::Getopt::OptionTypeMap;
subtype EnvVar,
as Str,
where { grep {defined &&
ap(
RequestParams , '=s'
);
coerce RequestParams,
from Str,
via {
decode_json($_);
};
enum RequestMethod , qw(get put post delete);
coerce RequestMethod,
from Str,