Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "names": [
- {
- "id":"<number>",
- "name":"<string>",
- "type":"<string>",
- }
- ]
- }
- @PUT
- @Path("/Id/{Id}/version/{version}/addPerson")
- public Response addPerson(@PathParam("Id") String Id,
- @PathParam("version") String version) {
- if (isNull(Id) || isEmpty(version)) {
- return ResponseBuilder.badRequest().build();
- }
- //HOW TO RECIEVE MESSAGE BODY?
- //carry out PUT request and return DTO: code not shown to keep example simple
- if (dto.isSuccess()) {
- return Response.ok().build();
- } else {
- return Response.serverError().build();
- }
- }
- @PUT
- @Consumes("application/json")
- @Path("/Id/{Id}/version/{version}/addPerson")
- public Response addPerson(@PathParam("Id") String Id,
- @PathParam("version") String version,
- List<NamObj> names) {
- @XmlRootElement
- public class NameObj {
- @XmlElement public int id;
- @XmlElement public String name;
- @XmlElement public String type;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement