summaryrefslogtreecommitdiff
path: root/eg/test.pl
blob: b77d0bb5a715ae2f8b77b219d55098315a6cf6ef (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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;