Skip to content

Commit

Permalink
ensure transport compression is on
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-zippenfenig committed Mar 14, 2024
1 parent 737d76d commit d0fd1bc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion OpenMeteo/OpenMeteo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ public OpenMeteoClient(HttpClient client)

public OpenMeteoClient()
{
this.Client = new HttpClient(new RetryHandler(new HttpClientHandler()));
HttpClientHandler handler = new HttpClientHandler();
handler.AutomaticDecompression = System.Net.DecompressionMethods.Deflate | System.Net.DecompressionMethods.GZip;
this.Client = new HttpClient(new RetryHandler(handler));
this.Client.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Encoding", "gzip, deflate");
}

/// <summary>
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# dotnet
.NET bindings to decode Open-Meteo Weather API responses based on FlatBuffers
.NET bindings to decode Open-Meteo Weather API responses based on FlatBuffers.

This library provides only basic functionality to decode binary FlatBuffers messages to efficiently transfer large amounts of weather data. It does not provide high level abstraction.


0 comments on commit d0fd1bc

Please # to comment.