Mailing List Archive

Requirement to add for C::A::Serialize::JSON to not give Content-Type application/json is not supported
Hello and... Marry Christmas!

I tried to use Catalyst::Controller::REST, but it returned the error
"Content-Type application/json is not supported.".

I've seen that somehow I had the module Catalyst::Action::Serialize::JSON
installed, so it should have been working.
I checked its source code and I've seen that it uses the module
JSON::MaybeXS, but I didn't have that module.
I installed it and now it works fine.

This is just a note that may be helpful for others that may have this
problem.
Also maybe JSON::MaybeXS will be added as a requirement for
Catalyst::Action::Serialize::JSON.

--Octavian


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/
Re: Requirement to add for C::A::Serialize::JSON to not give Content-Type application/json is not supported [ In reply to ]
For better or worse this distribution expects the user of it to add dependencies for the types they want to handle.  Otherwise we'd end up making people install dependencies for types they might not want.  It would make a good note in the docs somewhere (unless they are already around... I just could not find them).
FWIW if you are just doing basic JSON POST/GET stuff you might be interested to know that newer Catalyst supports that out of the box.  I find the build in stuff + Catalyst::View::JSON is enough for the basic JSON API needs I tend to have.  SO unless you need all the power of the REST package you might want to skip it.
jnap

On Friday, December 26, 2014 12:48 PM, Octavian Rasnita <orasnita@gmail.com> wrote:


Hello and... Marry Christmas!

I tried to use Catalyst::Controller::REST, but it returned the error
"Content-Type application/json is not supported.".

I've seen that somehow I had the module Catalyst::Action::Serialize::JSON
installed, so it should have been working.
I checked its source code and I've seen that it uses the module
JSON::MaybeXS, but I didn't have that module.
I installed it and now it works fine.

This is just a note that may be helpful for others that may have this
problem.
Also maybe JSON::MaybeXS will be added as a requirement for
Catalyst::Action::Serialize::JSON.

--Octavian


_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/