I am building a RESTful web-service in Java using Jersey 1.11, and have problems implementing a method which consumes a list of JSON-ised entities. The single instance method wo
This is valid JSON for an array:
{"elements": [
{"field1" : value1, "field2" : value2},
{"field1" : value3, "field2" : value4},
...]
};
(see here for an example)
You don't need to send text, you can send it as JSON. Also your MyEntity
should have @XmlRootElement
on it (see here, section 5.2 for an example).
You don't need PathParam
in your arguments, someParam
is available when the request is posted if you leave the @Path("/some-path/{someParam}")
in your method signature .