/** * Get collected report as JSON string * * @return */ public synchronized String reportJson() { return JsonTool.toJsonString(report()); }
OutputStream os = connection.getOutputStream(); if ("application/json".equals(contentType)) os.write(JsonTool.toJsonString(params).getBytes()); else os.write(getFormParams(params).getBytes());
public void setBodyAsJson(ScriptObjectMirror bodyAsJson) { response.setBody(JsonTool.toJsonString(bodyAsJson)); response.getHeaders().set("Content-type", "application/json"); }