Hi Bardo,

Are you talking about REST in C3 (cocoon-rest dependency) ?

Have you tried annotating REST Resource with:

@Consumes(MediaType.APPLICATION_JSON)

?

e.g.

@Path("/orders")
@Consumes(MediaType.APPLICATION_JSON)public class OrderRestResource {
                                                      [image: (2)]

    private Settings settings;

private static Map<Integer, Order> orders = new HashMap<Integer, Order>();

    @POST
    public void createOrder(Order order) {
        orders.put(order.id, order);
    }

}





2014-03-16 20:36 GMT+01:00 Bardo Nelgen <
mailing.list.in...@bnnperformances.de>:

>
> Hi all,
>
> has someone ever accessed the message body of a post request to cocoon
> which uses application/json as its content type?
>
> The same request is being handled without issues if posted as
> application/x-www-form-urlencoded.
>
> Though, as soon as the content type is changed to JSON, Cocoon appears to
> skip parsing the message body.
>
> Unfortunately it's not me making these POST calls; which is why just
> "switching it" is not an option.
>
> Is there some setting which can tell cocoon to simply continue parsing,
> either regardless of a post's content type (which, of course might raise
> security issues...) or explicitly for application/json ?
>
> Any suggestions are welcome.
>
> Regards,
>
> Bardo
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@cocoon.apache.org
> For additional commands, e-mail: users-h...@cocoon.apache.org
>
>

Reply via email to