I replaced the JacksonConverterService from the Jackson Restlet extension
with my local subclass (LocalJacksonConverterService) in order to override
its handling. At startup, I remove the existing one from the Engine and then
add my local version. I do it for a different reason -- to provide a
JacksonRepresentation subclass that overrides createObjectMapper -- but it
should still do the trick for you: Just override the JacksonConverterService
methods that test the MediaType, and remember to call super methods when you
need the original behavior.

--tim

On Thu, Feb 17, 2011 at 9:11 AM, gonzajg <[email protected]> wrote:

> Hi!
>
> I'm using Restlet 2.0.4 with JacksonConverterService
> The problem is that this configuration only accepts request with
> "Content-type application/json"
> Is there a way to ignore the content-type a parse anyway the body as
> application/json?
>
> I tried changing in the doinit and constructor serverResource methods
> request.getattributes.get(headers) the content type but there was no
> difference. Also I tried addind the variant but same problem
> I get method not supported.
>
> Thanks!
> --
> View this message in context:
> http://restlet-discuss.1400322.n2.nabble.com/Changing-content-type-tp6036044p6036044.html
> Sent from the Restlet Discuss mailing list archive at Nabble.com.
>
> ------------------------------------------------------
>
> http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2705059
>

------------------------------------------------------
http://restlet.tigris.org/ds/viewMessage.do?dsForumId=4447&dsMessageId=2705064

Reply via email to