Skip to content
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

Support compressed response #322

Open
ramil-mux opened this issue Oct 28, 2022 · 0 comments
Open

Support compressed response #322

ramil-mux opened this issue Oct 28, 2022 · 0 comments

Comments

@ramil-mux
Copy link

I have an OData server with OData controllers and an OData client from ODataConnectedService.
I read this answer, but HttpWebRequestMessage is marked as obsolete and this answer also doesn't work.
You advises to use HttpClientRequestMessage instead of HttpWebRequestMessage, but it doesn't have AutomaticDecompression property.
Does this client support compression?

Here is how I create the container:

_context = new Container(new Uri(url));
_context.SendingRequest2 += (sender, args) =>
{
    args.RequestMessage.SetHeader("Accept", "application/json");
    args.RequestMessage.SetHeader("Accept-Encoding", "gzip, deflate");
    
    ((HttpWebRequestMessage) args.RequestMessage).HttpWebRequest.AutomaticDecompression =
             DecompressionMethods.GZip | DecompressionMethods.Deflate;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant