Open rparrett opened 2 years ago
In order to make this fixable, it would be required to figure out how this call should look like possibly by referring to the original google docs for that API or intercepting a working request.
From there it might be possible to adjust the generator to deal with this - per API overrides or special cases are possibly by design. In any case, this will need to be contributed. Thanks for your understanding.
Hi, thanks for the response. I understand.
Unfortunately, I'm running into some deeply mysterious python errors attempting to build this thing, and I've found a workaround, so I likely won't be motivated to contribute a fix.
I will dump the information here though, in case it helps someone else.
Adding .header(CONTENT_LENGTH, 0);
to the generated code for the request builder for these API calls fixes the issue. This likely needs to be done for any POST
request with an empty body though, and I'm not sure what the best way to accomplish that is.
However, you can sidestep the issue by configuring your HttpsConnectionBuilder
to exclusively use http2
, like so:
let https = hyper_rustls::HttpsConnectorBuilder::new()
.with_native_roots()
.https_only()
.enable_http2()
.build();
Great, thanks for your help!
It seems that setting the content length should be very possible for the generator to do, and let me CC @kylegentle who has been helping a lot recently and might be in the position to make this improvement at some point.
Tested version
v4.0.1+20220303
Both of these calls are failing with HTTP 401 Length Required.