public final class JsonCContent extends JsonHttpContent
"data" envelope.
Warning: this should only be used by some older Google APIs that wrapped the response in a
"data" envelope. All newer Google APIs don't use this envelope, and for those APIs
JsonHttpContent should be used instead.
Sample usage:
static void setContent(HttpRequest request, Object data) {
JsonCContent content = new JsonCContent(new JacksonFactory(), data);
request.setContent(content);
}
Implementation is not thread-safe.
| Constructor and Description |
|---|
JsonCContent(JsonFactory jsonFactory,
Object data) |
| Modifier and Type | Method and Description |
|---|---|
JsonCContent |
setMediaType(HttpMediaType mediaType) |
void |
writeTo(OutputStream out) |
getData, getJsonFactorycomputeLength, getCharset, getEncoding, getLength, getMediaType, getType, retrySupportedpublic JsonCContent(JsonFactory jsonFactory, Object data)
jsonFactory - JSON factory to usedata - JSON key name/value datapublic void writeTo(OutputStream out) throws IOException
writeTo in interface HttpContentwriteTo in class JsonHttpContentIOExceptionpublic JsonCContent setMediaType(HttpMediaType mediaType)
setMediaType in class JsonHttpContentCopyright © 2010-2012 Google. All Rights Reserved.