Dancer2-Plugin-RPC-RESTISH

 view release on metacpan or  search on metacpan

example/lib/Example/API/MockDB.pm  view on Meta::CPAN


    return $self->db->{person}{$id};
}

=head2 update_person

=for restish POST@person/:id update_person

=cut

sub update_person {
    my $self = shift;
    my %data = %{ $_[0] };

    my $id = delete($data{id});
    if (!$id) {
        my $error = error_response(
            error_code => -32601,
            error_message => "Cannot update without ID...",
            error_data => \%data,
        );

t/lib/TestProject/ApiCalls.pm  view on Meta::CPAN


    return $_db->{person}{$id};
}

=head2 update_person

=for restish PATCH@person/:id update_person

=cut

sub update_person {
    my $method = shift;
    my %data = %{$_[0]};

    if (!exists($data{id})) {
        my $error = error_response(
            error_code => 9999,
            error_message => "Cannot update without ID",
            error_data => \%data,
        );
        $error->http_status(400); # bad request

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 1.296 second using v1.00-cache-2.02-grep-82fe00e-cpan-4673cadbf75 )