http.proto 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. // Copyright 2024 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. syntax = "proto3";
  15. package google.rpc;
  16. option go_package = "google.golang.org/genproto/googleapis/rpc/http;http";
  17. option java_multiple_files = true;
  18. option java_outer_classname = "HttpProto";
  19. option java_package = "com.google.rpc";
  20. option objc_class_prefix = "RPC";
  21. // Represents an HTTP request.
  22. message HttpRequest {
  23. // The HTTP request method.
  24. string method = 1;
  25. // The HTTP request URI.
  26. string uri = 2;
  27. // The HTTP request headers. The ordering of the headers is significant.
  28. // Multiple headers with the same key may present for the request.
  29. repeated HttpHeader headers = 3;
  30. // The HTTP request body. If the body is not expected, it should be empty.
  31. bytes body = 4;
  32. }
  33. // Represents an HTTP response.
  34. message HttpResponse {
  35. // The HTTP status code, such as 200 or 404.
  36. int32 status = 1;
  37. // The HTTP reason phrase, such as "OK" or "Not Found".
  38. string reason = 2;
  39. // The HTTP response headers. The ordering of the headers is significant.
  40. // Multiple headers with the same key may present for the response.
  41. repeated HttpHeader headers = 3;
  42. // The HTTP response body. If the body is not expected, it should be empty.
  43. bytes body = 4;
  44. }
  45. // Represents an HTTP header.
  46. message HttpHeader {
  47. // The HTTP header key. It is case insensitive.
  48. string key = 1;
  49. // The HTTP header value.
  50. string value = 2;
  51. }