I am unable to pass JSON data as POST.
{ "Member":{"id":"3" , "city":"Tokyo", "country":"Japan" }}
Is this the right format.
this is my interface:
@Path("/for")
public interface ReqService {
/**
* Adds an invite requested by the guest.
*/
@POST
@Path("/invite")
@Consumes("application/json")
public void addMember(Member mem);
}
and this is my implementation:
@Override
public void addMember(Member mem){
String rkey =mem.getId();
String col1 = mem.getCity();
String col2 = mem.getCountry();
myDAO.insertMulti(rkey, col1, col2);
}
@XmlRootElement(name = "Member")
@XmlType( propOrder = {"id", "city", "country" })
public class Member {
private String id;
private String city;
private String country;
getters & setters ..
regards,
Ramesh