diff options
| author | franck cuny <franck@lumberjaph.net> | 2010-09-13 13:31:56 +0200 |
|---|---|---|
| committer | franck cuny <franck@lumberjaph.net> | 2010-09-13 13:31:56 +0200 |
| commit | 3e3dc478fc9b4eb90681df89156dfcc8f7f81481 (patch) | |
| tree | b9788b0d48f524bc4c0aeeb48c744a8f7b097910 /eg/test.pl | |
| download | net-http-spore-3e3dc478fc9b4eb90681df89156dfcc8f7f81481.tar.gz | |
initial import
Diffstat (limited to 'eg/test.pl')
| -rw-r--r-- | eg/test.pl | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/eg/test.pl b/eg/test.pl new file mode 100644 index 0000000..b77d0bb --- /dev/null +++ b/eg/test.pl @@ -0,0 +1,21 @@ +use strict; +use warnings; +use 5.010; + +use Net::HTTP::Spore; + +my $api = Net::HTTP::Spore->new_from_spec(shift, api_base_url => 'http://localhost:5000'); + +$api->enable('Net::HTTP::Spore::Middleware::Format::JSON'); + +$api->enable( + 'Net::HTTP::Spore::Middleware::Auth::Basic', + username => 'admin', + password => 's3cr3t' +); + +my $content = + $api->new_user( input => { user => { francktest => { name => 'franck' } } } ); + +use YAML::Syck; +warn Dump $content; |
