|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.google.api.client.http.AbstractHttpContent
com.google.api.client.http.protobuf.ProtoHttpContent
public class ProtoHttpContent
Serializes of a protocol buffer message to HTTP content.
Sample usage:
static HttpRequest buildPostRequest(
HttpRequestFactory requestFactory, GenericUrl url, MessageLite message) throws IOException {
return requestFactory.buildPostRequest(url, new ProtoHttpContent(message));
}
Implementation is not thread-safe.
| Constructor Summary | |
|---|---|
ProtoHttpContent(com.google.protobuf.MessageLite message)
|
|
| Method Summary | |
|---|---|
long |
getLength()
|
com.google.protobuf.MessageLite |
getMessage()
Returns the message to serialize. |
String |
getType()
|
ProtoHttpContent |
setMediaType(HttpMediaType mediaType)
|
ProtoHttpContent |
setType(String type)
Sets the content type or null for none. |
void |
writeTo(OutputStream out)
|
| Methods inherited from class com.google.api.client.http.AbstractHttpContent |
|---|
computeLength, getCharset, getEncoding, getMediaType, retrySupported |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ProtoHttpContent(com.google.protobuf.MessageLite message)
message - message to serialize| Method Detail |
|---|
public long getLength()
throws IOException
getLength in interface HttpContentgetLength in class AbstractHttpContentIOExceptionpublic String getType()
getType in interface HttpContentgetType in class AbstractHttpContent
public void writeTo(OutputStream out)
throws IOException
IOExceptionpublic ProtoHttpContent setType(String type)
null for none.
Default value is ProtocolBuffers.CONTENT_TYPE.
public final com.google.protobuf.MessageLite getMessage()
public ProtoHttpContent setMediaType(HttpMediaType mediaType)
setMediaType in class AbstractHttpContent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||