com.google.api.client.googleapis.json
Class JsonCContent
java.lang.Object
com.google.api.client.http.AbstractHttpContent
com.google.api.client.http.json.JsonHttpContent
com.google.api.client.googleapis.json.JsonCContent
- All Implemented Interfaces:
- com.google.api.client.http.HttpContent
public final class JsonCContent
- extends com.google.api.client.http.json.JsonHttpContent
Serializes JSON-C content based on the data key/value mapping object for an item, wrapped in a
"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();
content.jsonFactory = new JacksonFactory();
content.data = data;
request.content = content;
}
- Since:
- 1.0
- Author:
- Yaniv Inbar
| Fields inherited from class com.google.api.client.http.json.JsonHttpContent |
contentType, data, jsonFactory |
| Methods inherited from class com.google.api.client.http.json.JsonHttpContent |
getData, getJsonFactory, getType, setType |
| Methods inherited from class com.google.api.client.http.AbstractHttpContent |
computeLength, getEncoding, getLength, retrySupported |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JsonCContent
@Deprecated
public JsonCContent()
- Deprecated. (scheduled to be removed in 1.6) Use
JsonCContent(JsonFactory, Object)
JsonCContent
public JsonCContent(com.google.api.client.json.JsonFactory jsonFactory,
Object data)
- Parameters:
jsonFactory - JSON factory to usedata - JSON key name/value data- Since:
- 1.5
writeTo
public void writeTo(OutputStream out)
throws IOException
- Specified by:
writeTo in interface com.google.api.client.http.HttpContent- Overrides:
writeTo in class com.google.api.client.http.json.JsonHttpContent
- Throws:
IOException
Copyright © 2010-2011 Google. All Rights Reserved.