Package com.yahoo.restapi
Class JsonResponse
java.lang.Object
com.yahoo.container.jdisc.HttpResponse
com.yahoo.restapi.JsonResponse
-
Field Summary
Fields inherited from class com.yahoo.container.jdisc.HttpResponse
DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE -
Constructor Summary
ConstructorsConstructorDescriptionJsonResponse(int statusCode, ai.vespa.json.Json json) JsonResponse(int statusCode, ai.vespa.json.Json json, boolean compact) JsonResponse(ai.vespa.json.Json json) JsonResponse(ai.vespa.json.Json json, boolean compact) -
Method Summary
Modifier and TypeMethodDescriptionThe MIME type of the response contents or null.voidrender(OutputStream stream) Marshals this response to the network layer.Methods inherited from class com.yahoo.container.jdisc.HttpResponse
complete, getCharacterEncoding, getJdiscResponse, getLogValues, getRequestType, getStatus, headers, maxPendingBytes, populateAccessLogEntry, setRequestType, setStatus
-
Constructor Details
-
JsonResponse
public JsonResponse() -
JsonResponse
public JsonResponse(ai.vespa.json.Json json) -
JsonResponse
public JsonResponse(ai.vespa.json.Json json, boolean compact) -
JsonResponse
public JsonResponse(int statusCode, ai.vespa.json.Json json) -
JsonResponse
public JsonResponse(int statusCode, ai.vespa.json.Json json, boolean compact)
-
-
Method Details
-
render
Description copied from class:HttpResponseMarshals this response to the network layer. The caller is responsible for flushing and closing outputStream.- Specified by:
renderin classHttpResponse- Throws:
IOException
-
getContentType
Description copied from class:HttpResponseThe MIME type of the response contents or null. If null is returned, no content type header is added to the HTTP response.- Overrides:
getContentTypein classHttpResponse- Returns:
- by default
HttpResponse.DEFAULT_MIME_TYPE
-