RESTful Web サーバーで JSON オブジェクトを使用するにはどうすればよいですか。クライアントはどうあるべきか。ジャージーサーバーを使用しています。元。
//BEAN
public class Student{
public String name;
}
//SERVER
@POST @Consumes("application/json")
@Path("/create")
public void create(Student s1) {
System.out.println(s1.name);
}
//CLIENT
ClientConfig config1 = new DefaultClientConfig();
Client client1 = Client.create(config1);
client1.addFilter(new LoggingFilter());
WebResource service1 = client1.resource(getBaseURI());
Student s = new WSTestClient.Student();
s.name="POP";
service1.path("create").type(MediaType.APPLICATION_JSON).post(s);
動いていない...