-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Garbled request body #1439
Comments
Hi @qwertycho, Thanks for trying out the SDK. |
Thank you @rkodev ! I have disabled the compression with this snipped:
The compression is a bit annoying when the api does not support it. I did notice that the CompressionHandler is not in exported in the http fetch library, so that limits discoverability. Although it seems there isn't much to configure anyway. |
@qwertycho When the API you're targeting replies to the compressed request, does it send back a 415 status code? Or something else? We didn't get any feedback about APIs not supporting request body compression in other languages where it's been implemented to date as far as I know. The addition of this handler by default is guided by our design guidelines Can you expand on the export comment you were making please? |
I find it bizarre that requests are compressed by default. In my decade+ of web development, I've never heard of compressing json payloads sent to a server (only responses). Furthermore, given that Kiota is closely related to ASP.NET core and ASP.NET core fails to recognized compressed data by default, Kiota basically is broken out of the box for ASP.NET backends. Disabling compression as per the comment above worked for me. |
@baywet The kiota-http-fetchlibrary exports all the middlewares (RedirectHandler, RetryHandler, etc) except for the CompressionHandler. So if somebody wanted to build a HttpClient with a custom set of middleware, they won't be able to use the CompressionHandler. As far as i can see the only thing that is configurable in the CompressionHandler is the 'enableCompression' flag, so that's why i said that there isn't much to configure. |
Hitting this same issue here: Apicurio/apicurio-registry#5498 So, I can confirm that Java server are being affected by this issue too. |
Thank you for the additional information. @qwertycho are you referring to the missing entries here and there ?? This is most likely an oversight. As for request compression being enabled by default, extrapolating from Microsoft Graph we might have made two assumptions that are not holding:
What's strange is that go has been our canary and has supported request body compression for over 2 years now. While we received feedback about content range and other aspects where compression should NOT be applied, we have not received feedback asking to disable request body compression all together. We could consider disabling request compression by default (and only enabling it in Microsoft Graph core), but before we go there, I'd love to brainstorm potential solutions to:
|
For reference, in the Java world, either in Spring Boot and Quarkus enabling compression is still opt in(i.e. disabled by default). |
@baywet As for for compression being enabled by default: I think it's fine, as long as it's properly documented. When looking at the documentation there is no mention of compression being enabled. Currently the only mention of default middleware is I think that it would be good to mention the different middleware handlers that are enabled by default in the quickstart guides and then link to the middleware page. |
Thank you for the additional information. Can you please create an issue here for the gap in public documentation? |
When sending a post request the json body becomes an arbitrary data.
Example
Sample
vite react + typescript project
api
dotnet 8 webapplication
The text was updated successfully, but these errors were encountered: