com.sdklite.sphere.hybrid.JSONResponse Maven / Gradle / Ivy
package com.sdklite.sphere.hybrid;
import java.io.ByteArrayInputStream;
import org.json.JSONArray;
import org.json.JSONObject;
/**
* The {@link JSONResponse} represent a JSON resource
*
* @author johnsonlee
* @since 1.0.0
*/
public final class JSONResponse extends MimeTypeResponse {
public JSONResponse() {
super(JSON, "utf-8", new ByteArrayInputStream("{}".getBytes()));
}
public JSONResponse(final JSONObject json) {
super(JSON, "utf-8", new ByteArrayInputStream(String.valueOf(json).getBytes()));
}
public JSONResponse(final JSONArray json) {
super(JSON, "utf-8", new ByteArrayInputStream(String.valueOf(json).getBytes()));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy