diff --git a/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java b/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java index 36b5a764a..5bd5ea871 100644 --- a/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java +++ b/li.strolch.rest/src/main/java/li/strolch/rest/helper/ResponseUtil.java @@ -36,6 +36,17 @@ public class ResponseUtil { return Response.ok(json, MediaType.APPLICATION_JSON).build(); } + public static Response toResponse(String prop1, String value1, String prop2, String value2) { + JsonObject response = new JsonObject(); + response.addProperty(MSG, StringHelper.DASH); + response.addProperty(prop1, value1); + response.addProperty(prop2, value2); + + String json = new Gson().toJson(response); + + return Response.ok(json, MediaType.APPLICATION_JSON).build(); + } + public static Response toResponse(String member, JsonElement jsonElement) { JsonObject response = new JsonObject(); response.addProperty(MSG, StringHelper.DASH);