Debian Codegraph @

google/api/httpbody.proto

raw
1 // Copyright 2026 Google LLC
2 //
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
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
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.
14
15 syntax = "proto3";
16
17 package google.api;
18
19 import "google/protobuf/any.proto";
20
21 option go_package = "google.golang.org/genproto/googleapis/api/httpbody;httpbody";
22 option java_multiple_files = true;
23 option java_outer_classname = "HttpBodyProto";
24 option java_package = "com.google.api";
25 option objc_class_prefix = "GAPI";
26
27 // Message that represents an arbitrary HTTP body. It should only be used for
28 // payload formats that can't be represented as JSON, such as raw binary or
29 // an HTML page.
30 //
31 //
32 // This message can be used both in streaming and non-streaming API methods in
33 // the request as well as the response.
34 //
35 // It can be used as a top-level request field, which is convenient if one
36 // wants to extract parameters from either the URL or HTTP template into the
37 // request fields and also want access to the raw HTTP body.
38 //
39 // Example:
40 //
41 // message GetResourceRequest {
42 // // A unique request id.
43 // string request_id = 1;
44 //
45 // // The raw HTTP body is bound to this field.
46 // google.api.HttpBody http_body = 2;
47 //
48 // }
49 //
50 // service ResourceService {
51 // rpc GetResource(GetResourceRequest)
52 // returns (google.api.HttpBody);
53 // rpc UpdateResource(google.api.HttpBody)
54 // returns (google.protobuf.Empty);
55 //
56 // }
57 //
58 // Example with streaming methods:
59 //
60 // service CaldavService {
61 // rpc GetCalendar(stream google.api.HttpBody)
62 // returns (stream google.api.HttpBody);
63 // rpc UpdateCalendar(stream google.api.HttpBody)
64 // returns (stream google.api.HttpBody);
65 //
66 // }
67 //
68 // Use of this type only changes how the request and response bodies are
69 // handled, all other features will continue to work unchanged.
70 message HttpBody {
71 // The HTTP Content-Type header value specifying the content type of the body.
72 string content_type = 1;
73
74 // The HTTP request/response body as raw binary.
75 bytes data = 2;
76
77 // Application specific response metadata. Must be set in the first response
78 // for streaming APIs.
79 repeated google.protobuf.Any extensions = 3;
80 }