in reply to Dancer2 serializer mutable

Note that XML isn't supported by Dancer2::Serializer::Mutable, it handles JSON, YAML, and Data::Dumper only.

It works for me when I specify

curl -H 'Accept: application/json' http://localhost:3000/user/1

i.e. I use Accept instead of Accept-Type (Content-Type works, too), and I switch to a supported output format.

Update: The code mentions XML, but it seems to treat it the same way as HTML, i.e. it needs a template to fill with the data. I tried to create a new XML serializer, but I don't understand all the details, so I wasn't successful.

($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,

Replies are listed 'Best First'.
Re^2: Dancer2 serializer mutable
by perl_help27 (Acolyte) on Nov 08, 2018 at 22:20 UTC
    Thank you LOTS for your answer... this call works however curl -H 'Accept: text/x-yaml' http://localhost:3000/user/1 doesn't return anything either:S do you know why?
      It doesn't return anything to me, either. Maybe a specific YAML library is needed? You can always report a bug against Dancer2.

      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
        Ok thanks a lot! I think I am just gonna ditch that since I do need xml :S