Class JsonResponse
- java.lang.Object
-
- com.yahoo.container.jdisc.HttpResponse
-
- com.yahoo.container.handler.metrics.JsonResponse
-
- Direct Known Subclasses:
ErrorResponse
public class JsonResponse extends HttpResponse
- Author:
- gjoranv
-
-
Field Summary
-
Fields inherited from class com.yahoo.container.jdisc.HttpResponse
DEFAULT_CHARACTER_ENCODING, DEFAULT_MIME_TYPE
-
-
Constructor Summary
Constructors Constructor Description JsonResponse(int code, java.lang.String data)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getContentType()
The MIME type of the response contents or null.void
render(java.io.OutputStream outputStream)
Marshal this response to the network layer.-
Methods inherited from class com.yahoo.container.jdisc.HttpResponse
complete, getCharacterEncoding, getJdiscResponse, getLogValues, getStatus, headers, populateAccessLogEntry, setStatus
-
-
-
-
Method Detail
-
getContentType
public java.lang.String getContentType()
Description copied from class:HttpResponse
The MIME type of the response contents or null. If null is returned, no content type header is added to the HTTP response.- Overrides:
getContentType
in classHttpResponse
- Returns:
- by default
HttpResponse.DEFAULT_MIME_TYPE
-
render
public void render(java.io.OutputStream outputStream) throws java.io.IOException
Description copied from class:HttpResponse
Marshal this response to the network layer. The caller is responsible for flushing and closing outputStream.- Specified by:
render
in classHttpResponse
- Throws:
java.io.IOException
-
-