public final class HttpBody extends GeneratedMessageV3 implements HttpBodyOrBuilder
Message that represents an arbitrary HTTP body. It should only be used for
payload formats that can't be represented as JSON, such as raw binary or
an HTML page.
This message can be used both in streaming and non-streaming API methods in
the request as well as the response.
It can be used as a top-level request field, which is convenient if one
wants to extract parameters from either the URL or HTTP template into the
request fields and also want access to the raw HTTP body.
Example:
message GetResourceRequest {
// A unique request id.
string request_id = 1;
// The raw HTTP body is bound to this field.
google.api.HttpBody http_body = 2;
}
service ResourceService {
rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
rpc UpdateResource(google.api.HttpBody) returns
(google.protobuf.Empty);
}
Example with streaming methods:
service CaldavService {
rpc GetCalendar(stream google.api.HttpBody)
returns (stream google.api.HttpBody);
rpc UpdateCalendar(stream google.api.HttpBody)
returns (stream google.api.HttpBody);
}
Use of this type only changes how the request and response bodies are
handled, all other features will continue to work unchanged.
Protobuf type google.api.HttpBody| Modifier and Type | Class and Description |
|---|---|
static class |
HttpBody.Builder
Message that represents an arbitrary HTTP body.
|
GeneratedMessageV3.BuilderParent, GeneratedMessageV3.ExtendableBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage,BuilderType extends GeneratedMessageV3.ExtendableBuilder<MessageType,BuilderType>>, GeneratedMessageV3.ExtendableMessage<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.ExtendableMessageOrBuilder<MessageType extends GeneratedMessageV3.ExtendableMessage>, GeneratedMessageV3.FieldAccessorTable| Modifier and Type | Field and Description |
|---|---|
static int |
CONTENT_TYPE_FIELD_NUMBER |
static int |
DATA_FIELD_NUMBER |
static int |
EXTENSIONS_FIELD_NUMBER |
alwaysUseFieldBuilders, unknownFieldsmemoizedSizememoizedHashCode| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getContentType()
The HTTP Content-Type header value specifying the content type of the body.
|
ByteString |
getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
|
ByteString |
getData()
The HTTP request/response body as raw binary.
|
static HttpBody |
getDefaultInstance() |
HttpBody |
getDefaultInstanceForType() |
static Descriptors.Descriptor |
getDescriptor() |
Any |
getExtensions(int index)
Application specific response metadata.
|
int |
getExtensionsCount()
Application specific response metadata.
|
java.util.List<Any> |
getExtensionsList()
Application specific response metadata.
|
AnyOrBuilder |
getExtensionsOrBuilder(int index)
Application specific response metadata.
|
java.util.List<? extends AnyOrBuilder> |
getExtensionsOrBuilderList()
Application specific response metadata.
|
Parser<HttpBody> |
getParserForType() |
int |
getSerializedSize() |
UnknownFieldSet |
getUnknownFields() |
int |
hashCode() |
protected GeneratedMessageV3.FieldAccessorTable |
internalGetFieldAccessorTable() |
boolean |
isInitialized() |
static HttpBody.Builder |
newBuilder() |
static HttpBody.Builder |
newBuilder(HttpBody prototype) |
HttpBody.Builder |
newBuilderForType() |
protected HttpBody.Builder |
newBuilderForType(GeneratedMessageV3.BuilderParent parent) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input) |
static HttpBody |
parseDelimitedFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(byte[] data) |
static HttpBody |
parseFrom(byte[] data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data) |
static HttpBody |
parseFrom(java.nio.ByteBuffer data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(ByteString data) |
static HttpBody |
parseFrom(ByteString data,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(CodedInputStream input) |
static HttpBody |
parseFrom(CodedInputStream input,
ExtensionRegistryLite extensionRegistry) |
static HttpBody |
parseFrom(java.io.InputStream input) |
static HttpBody |
parseFrom(java.io.InputStream input,
ExtensionRegistryLite extensionRegistry) |
static Parser<HttpBody> |
parser() |
HttpBody.Builder |
toBuilder() |
void |
writeTo(CodedOutputStream output) |
canUseUnsafe, computeStringSize, computeStringSizeNoTag, emptyBooleanList, emptyDoubleList, emptyFloatList, emptyIntList, emptyLongList, getAllFields, getDescriptorForType, getField, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneof, internalGetMapField, makeExtensionsImmutable, mutableCopy, mutableCopy, mutableCopy, mutableCopy, mutableCopy, newBooleanList, newBuilderForType, newDoubleList, newFloatList, newIntList, newLongList, parseDelimitedWithIOException, parseDelimitedWithIOException, parseUnknownField, parseUnknownFieldProto3, parseWithIOException, parseWithIOException, parseWithIOException, parseWithIOException, serializeBooleanMapTo, serializeIntegerMapTo, serializeLongMapTo, serializeStringMapTo, writeReplace, writeString, writeStringNoTagfindInitializationErrors, getInitializationErrorString, hashBoolean, hashEnum, hashEnumList, hashFields, hashLong, toStringaddAll, addAll, checkByteStringIsUtf8, toByteArray, toByteString, writeDelimitedTo, writeToclone, finalize, getClass, notify, notifyAll, wait, wait, waitfindInitializationErrors, getAllFields, getDescriptorForType, getField, getInitializationErrorString, getOneofFieldDescriptor, getRepeatedField, getRepeatedFieldCount, hasField, hasOneoftoByteArray, toByteString, writeDelimitedTo, writeTopublic static final int CONTENT_TYPE_FIELD_NUMBER
public static final int DATA_FIELD_NUMBER
public static final int EXTENSIONS_FIELD_NUMBER
public final UnknownFieldSet getUnknownFields()
getUnknownFields in interface MessageOrBuildergetUnknownFields in class GeneratedMessageV3public static final Descriptors.Descriptor getDescriptor()
protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
internalGetFieldAccessorTable in class GeneratedMessageV3public java.lang.String getContentType()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;getContentType in interface HttpBodyOrBuilderpublic ByteString getContentTypeBytes()
The HTTP Content-Type header value specifying the content type of the body.
string content_type = 1;getContentTypeBytes in interface HttpBodyOrBuilderpublic ByteString getData()
The HTTP request/response body as raw binary.
bytes data = 2;getData in interface HttpBodyOrBuilderpublic java.util.List<Any> getExtensionsList()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;getExtensionsList in interface HttpBodyOrBuilderpublic java.util.List<? extends AnyOrBuilder> getExtensionsOrBuilderList()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;getExtensionsOrBuilderList in interface HttpBodyOrBuilderpublic int getExtensionsCount()
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;getExtensionsCount in interface HttpBodyOrBuilderpublic Any getExtensions(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;getExtensions in interface HttpBodyOrBuilderpublic AnyOrBuilder getExtensionsOrBuilder(int index)
Application specific response metadata. Must be set in the first response for streaming APIs.
repeated .google.protobuf.Any extensions = 3;getExtensionsOrBuilder in interface HttpBodyOrBuilderpublic final boolean isInitialized()
isInitialized in interface MessageLiteOrBuilderisInitialized in class GeneratedMessageV3public void writeTo(CodedOutputStream output) throws java.io.IOException
writeTo in interface MessageLitewriteTo in class GeneratedMessageV3java.io.IOExceptionpublic int getSerializedSize()
getSerializedSize in interface MessageLitegetSerializedSize in class GeneratedMessageV3public boolean equals(java.lang.Object obj)
equals in interface Messageequals in class AbstractMessagepublic int hashCode()
hashCode in interface MessagehashCode in class AbstractMessagepublic static HttpBody parseFrom(java.nio.ByteBuffer data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(java.nio.ByteBuffer data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(ByteString data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(byte[] data) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry) throws InvalidProtocolBufferException
InvalidProtocolBufferExceptionpublic static HttpBody parseFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseDelimitedFrom(java.io.InputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseDelimitedFrom(java.io.InputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(CodedInputStream input) throws java.io.IOException
java.io.IOExceptionpublic static HttpBody parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry) throws java.io.IOException
java.io.IOExceptionpublic HttpBody.Builder newBuilderForType()
newBuilderForType in interface MessagenewBuilderForType in interface MessageLitepublic static HttpBody.Builder newBuilder()
public static HttpBody.Builder newBuilder(HttpBody prototype)
public HttpBody.Builder toBuilder()
toBuilder in interface MessagetoBuilder in interface MessageLiteprotected HttpBody.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
newBuilderForType in class GeneratedMessageV3public static HttpBody getDefaultInstance()
public Parser<HttpBody> getParserForType()
getParserForType in interface MessagegetParserForType in interface MessageLitegetParserForType in class GeneratedMessageV3public HttpBody getDefaultInstanceForType()
getDefaultInstanceForType in interface MessageLiteOrBuildergetDefaultInstanceForType in interface MessageOrBuilder