Skip to content

Commit

Permalink
refactor(proto): redefine HTTP headers structure
Browse files Browse the repository at this point in the history
Because who doesn't love a little complexity?
  • Loading branch information
madflojo committed Nov 3, 2024
1 parent 808e37c commit a697755
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions sdk/http.proto
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ message HTTPClient {
string method = 1;

// Headers are the HTTP headers to include in the HTTP request.
map<string, string> headers = 2;
map<string, Header> headers = 2;

// URL is the HTTP URL to call.
string url = 3;
Expand All @@ -37,10 +37,19 @@ message HTTPClientResponse {
int32 code = 2;

// Headers are the HTTP headers returned from the HTTP request.
map<string, string> headers = 3;
map<string, Header> headers = 3;

// Body is the server-supplied HTTP payload data. The server-supplied payload
// will be a byte slice.
bytes body = 4;
}

// Header is a structure used to define HTTP headers for HTTP requests.
// As HTTP headers can have multiple values, this structure is used to define
// the header values.
message Header {
// Value is the HTTP header value to include in requests and responses.
// This field is a repeated field to allow for multiple values
// which is allowed in HTTP headers.
repeated string value = 2;
}

0 comments on commit a697755

Please sign in to comment.