hello monks,
I am trying to run this basic app in perl:
use Dancer2;
set serializer => 'Mutable';
get '/user/:id' => sub {
my $id = params->{id};
return { id => $id, name => 'frank' };
}
dance;
I then call this url
curl -H 'Accept-Type: text/xml' http://localhost:5000/user/1
I expect it to return
<data name="franck" id="1" /> But instead I am receiving this error:
{"id" => 1,"name" => "frank"} did not pass type constraint "Value" (i
+n $self->{"content"})
"Value" is defined as: (defined($_) and not ref($_)) in /usr/local
+/share/perl5/Dancer2/Core/App.pm l. 1473
I am running hopeless!! Any help would do.
Thanks