We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36f9139 commit a9bc5a7Copy full SHA for a9bc5a7
lib/rorvswild/client.rb
@@ -2,6 +2,7 @@
2
3
require "set"
4
require "uri"
5
+require "zlib"
6
require "json/ext"
7
require "net/http"
8
@@ -24,6 +25,7 @@ def initialize(config)
24
25
@mutex = Mutex.new
26
@config = config
27
@headers = {
28
+ "Content-Encoding" => "deflate",
29
"Content-Type" => "application/json",
30
"X-RorVsWild-Version" => RorVsWild::VERSION,
31
"X-Ruby-Version" => RUBY_VERSION,
@@ -36,7 +38,7 @@ def post(path, data)
36
38
uri = URI(api_url + path)
37
39
post = Net::HTTP::Post.new(uri.path, @headers)
40
post.basic_auth(nil, api_key)
- post.body = JSON.generate(data)
41
+ post.body = Zlib.deflate(JSON.generate(data), Zlib::BEST_SPEED)
42
transmit(post)
43
end
44
0 commit comments