1 // Copyright 2018 Google LLC.
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
7 // http://www.apache.org/licenses/LICENSE-2.0
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
20 import "google/protobuf/any.proto";
22 option cc_enable_arenas = true;
23 option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
24 option java_multiple_files = true;
25 option java_outer_classname = "HttpBodyProto";
26 option java_package = "com.google.api";
27 option objc_class_prefix = "GAPI";
29 // Message that represents an arbitrary HTTP body. It should only be used for
30 // payload formats that can't be represented as JSON, such as raw binary or
34 // This message can be used both in streaming and non-streaming API methods in
35 // the request as well as the response.
37 // It can be used as a top-level request field, which is convenient if one
38 // wants to extract parameters from either the URL or HTTP template into the
39 // request fields and also want access to the raw HTTP body.
43 // message GetResourceRequest {
44 // // A unique request id.
45 // string request_id = 1;
47 // // The raw HTTP body is bound to this field.
48 // google.api.HttpBody http_body = 2;
51 // service ResourceService {
52 // rpc GetResource(GetResourceRequest) returns (google.api.HttpBody);
53 // rpc UpdateResource(google.api.HttpBody) returns
54 // (google.protobuf.Empty);
57 // Example with streaming methods:
59 // service CaldavService {
60 // rpc GetCalendar(stream google.api.HttpBody)
61 // returns (stream google.api.HttpBody);
62 // rpc UpdateCalendar(stream google.api.HttpBody)
63 // returns (stream google.api.HttpBody);
66 // Use of this type only changes how the request and response bodies are
67 // handled, all other features will continue to work unchanged.
69 // The HTTP Content-Type header value specifying the content type of the body.
70 string content_type = 1;
72 // The HTTP request/response body as raw binary.
75 // Application specific response metadata. Must be set in the first response
76 // for streaming APIs.
77 repeated google.protobuf.Any extensions = 3;