|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.http.json.JsonHttpContent
public class JsonHttpContent
Serializes JSON HTTP content based on the data key/value mapping object for an item.
Sample usage:
static void setContent(HttpRequest request, Object data) {
JsonHttpContent content = new JsonHttpContent();
content.jsonFactory = new JacksonFactory();
content.data = data;
request.content = content;
}
| Field Summary | |
|---|---|
String |
contentType
Content type. |
Object |
data
Key/value pair data. |
JsonFactory |
jsonFactory
(Required) JSON factory to use. |
| Constructor Summary | |
|---|---|
JsonHttpContent()
|
|
| Method Summary | |
|---|---|
String |
getEncoding()
Returns the content encoding (for example "gzip") or null for none. |
long |
getLength()
Returns the content length or less than zero if not known. |
String |
getType()
Returns the content type or null for none. |
boolean |
retrySupported()
Returns whether or not retry is supported on this content type. |
void |
writeTo(OutputStream out)
Writes the content to the given output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public String contentType
Json.CONTENT_TYPE.
public Object data
public JsonFactory jsonFactory
| Constructor Detail |
|---|
public JsonHttpContent()
| Method Detail |
|---|
public long getLength()
HttpContent
getLength in interface HttpContentpublic final String getEncoding()
HttpContent"gzip") or null for none.
getEncoding in interface HttpContentpublic String getType()
HttpContentnull for none.
getType in interface HttpContent
public void writeTo(OutputStream out)
throws IOException
HttpContent
writeTo in interface HttpContentIOExceptionpublic boolean retrySupported()
HttpContent
retrySupported in interface HttpContent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||