Re: Accessing application/json message body of POST request

2014-03-17 Thread Bardo Nelgen
Hi Warrell, thanks for the input. Though our problem actually isn't *processing* the JSON, but initially getting it out of a POST request's application/json message body at all. If the JSON is postet wwwform-urlencoded and comes with common variable-value pairs, indeed a variety of options

Re: Accessing application/json message body of POST request

2014-03-17 Thread gelo1234
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 {

Re: Accessing application/json message body of POST request

2014-03-17 Thread gelo1234
Sorry, my mail got cut in the middle. So, you should place @Consumes annotation in REST Resource + all that Spring config explained here: https://cocoon.apache.org/3.0/reference/html-single/index.html#webapps.rest AND JSONProvider in spring config: bean id=jsonProvider

Accessing application/json message body of POST request

2014-03-16 Thread Bardo Nelgen
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

Re: Accessing application/json message body of POST request

2014-03-16 Thread warrell harries
Hi Bardo, The simplest way that I have found to handle json posts is to use the text generator. Alternatively, you are free to write a json generator which would convert json to xml as this is the default data format of cocoon. I have been successfuly using cocoon to handle json (the