public sealed class HttpBody : IMessage<HttpBody>, IEquatable<HttpBody>, IDeepCloneable<HttpBody>, IBufferMessage, IMessage
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);
}
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-05 UTC."],[[["The `HttpBody` class represents an arbitrary HTTP body, designed for payload formats that are not JSON, like raw binary or HTML."],["`HttpBody` can be used in both streaming and non-streaming API methods, in the request and response, and as a top-level request field."],["The `HttpBody` class contains properties for `ContentType`, `Data` as raw binary, and `Extensions` for application-specific metadata."],["The `HttpBody` class provides methods for calculating the size, creating deep clones, merging messages, and writing data to a coded output stream."],["The latest version available for `HttpBody` is version 2.15.0, but versions 2.10.0 and 2.2.0 are also available."]]],[]]