http://lj.platformatyourservice.com/lj80/Category:REST_API
// create the rest client instance
RestClient client = new RestClient();
// create the resource instance
Resource resource = client.resource("http://localhost:8088/testWink1/rest/bookmarks/login");
JSONArray response = (JSONArray) resource.accept(MediaType.APPLICATION_JSON).post(JSONArray.class, "");
String session_id = "";
try {
session_id = (String) response.getJSONObject(0).get("session-id");
System.out.println("######client-session-id : " + session_id);
} catch (JSONException e) {
e.printStackTrace();
}
System.out.println(response);
resource = client.resource("http://localhost:8088/testWink1/rest/bookmarks/88/work");
resource.header("Cookie", "JSESSIONID=" + session_id);
JSONObject response1 = resource.accept(MediaType.APPLICATION_JSON).post(JSONObject.class, "");
System.out.println(response1);