Ian Botsford
11/22/2022, 4:14 PMZac Sweers
11/22/2022, 4:17 PMeygraber
11/22/2022, 4:23 PMA payload within a GET request message has no defined semantics;
sending a payload body on a GET request might cause some existing
implementations to reject the request.
I wouldn't say it doesn't adhere to it, since it isn't forbidden. Maybe it's just ill advised
Aaron Todd
11/22/2022, 4:36 PMDoes AWS often write endpoints that donât adhere to the HTTP spec?Out of 11k+ operations across 300+ services we have identified < 10 operations that use
GET
with a body.
There is now model validation in place to prevent introducing new APIs from using GET
with a body.
I wouldn't call it common but some older APIs have unfortunately modeled their operations this way.kenkyee
11/22/2022, 5:25 PMeygraber
11/22/2022, 5:25 PMIan Botsford
11/22/2022, 5:28 PMIan Botsford
11/22/2022, 5:30 PMZac Sweers
11/22/2022, 5:33 PMZac Sweers
11/22/2022, 5:34 PMkenkyee
11/22/2022, 5:36 PMkevin.cianfarini
11/22/2022, 5:36 PMIan Botsford
11/22/2022, 5:37 PMPresumably your SDK is hiding these behind some abstraction layer, maybe you can just fall back to URLConnection or use Javaâs HttpClient for those under the hoodWe allow callers to configure their HTTP client as part of configuring their SDK client. Falling back to another client would ignore their custom OkHttp settings and may behave in ways they don't expect. Ideally, we'd like to use one HTTP client for all requests from a configured SDK client.
Zac Sweers
11/22/2022, 5:38 PMIan Botsford
11/22/2022, 5:38 PMout-of-spec support for bodies on GETsAre bodies on GETs out of spec? My reading of the HTTP RFCs says "no".
Zac Sweers
11/22/2022, 5:40 PMZac Sweers
11/22/2022, 5:41 PMAaron Todd
11/22/2022, 5:41 PMAaron Todd
11/22/2022, 5:45 PMZac Sweers
11/22/2022, 5:53 PMkenkyee
11/22/2022, 5:54 PMyschimke
11/22/2022, 5:57 PMyschimke
11/22/2022, 6:03 PMIan Botsford
11/22/2022, 6:14 PMyschimke
11/22/2022, 6:16 PMsending a payload body on a GET request might cause some existing
implementations to reject the request.
Ian Botsford
11/22/2022, 6:21 PMyschimke
11/22/2022, 6:34 PMkenkyee
11/22/2022, 6:38 PMkenkyee
11/22/2022, 6:38 PMIan Botsford
11/22/2022, 6:48 PMA client SHOULD NOT generate content in a GET request unless it is made directly to an origin server that has previously indicated, in or out of band, that such a request has a purpose and will be adequately supported.In this wording, "previously indicated...that such a request has a purpose and will be adequately supported" seems to be a reason when GET bodies should be allowed. Otherwise, clients shouldn't just send a GET body to a specific endpoint and hope it can deal with it.
Ian Botsford
11/22/2022, 6:48 PMIan Botsford
11/22/2022, 6:48 PMyschimke
11/22/2022, 6:50 PMyschimke
11/22/2022, 6:55 PM```An HTTP GET request includes request header fields and no payload
body and is therefore transmitted as a single HEADERS frame```This would also make it tougher, a client would only know if the request can be transmitted by forcing HTTP/1.1 for the client.
Ian Botsford
11/22/2022, 9:48 PMjessewilson
11/23/2022, 12:49 PM|
in URLs cause browsers do, and itâs occasionally used, cause thatâs what browsers do.jessewilson
11/23/2022, 12:50 PMjessewilson
11/23/2022, 12:53 PMjessewilson
11/23/2022, 12:57 PMjessewilson
11/23/2022, 1:02 PMjessewilson
11/23/2022, 1:04 PMjessewilson
11/23/2022, 1:08 PMjessewilson
11/23/2022, 1:10 PMyschimke
11/23/2022, 1:15 PMAaron Todd
11/23/2022, 2:12 PMThe Http/2 spec is also troubling, would it only work for Http/1.1?There are already parts of OkHttp that are only compatible on H2 (e.g.
RequestBody.isDuplex
) 𤡠. Our inclination here was that if OkHttp was open to a path to allowing this it would be an opt-in thing (basically saying "yes I understand this isn't universally supported, I know what I'm doing").
I bet if you ask the corresponding service owners they might tell you they already support POST as well.If only this were true đ We appreciate your position and all of the feedback. We are burning this issue from both ends, we just wanted to open up a dialogue about the implementation w.r.t the RFC. From our interpretation of the RFC if clients and servers agree to
GET
with body then it's fine, just don't expect universal support. We don't take this to mean that clients should prevent it (for HTTP/1.1 at least) just that server/proxy support may be a problem.
I think we have our answer though so as Ian said thanks for the discussion!jessewilson
02/19/2023, 2:43 PMjessewilson
02/19/2023, 2:43 PMjessewilson
02/19/2023, 2:45 PMjessewilson
02/19/2023, 2:46 PMMarcin Wisniowski
02/19/2023, 4:29 PM