lib/deepl/requests/base.rb in deepl-rb-2.2.2 vs lib/deepl/requests/base.rb in deepl-rb-2.2.3
- old
+ new
@@ -1,5 +1,7 @@
+# frozen_string_literal: true
+
module DeepL
module Requests
class Base
attr_reader :api, :response, :options
@@ -30,10 +32,10 @@
end
end
def post(payload)
request = Net::HTTP::Post.new(uri.request_uri)
- request.set_form_data(payload.reject { |_, v| v.nil? })
+ request.set_form_data(payload.compact)
response = http.request(request)
validate_response!(request, response)
[request, response]
end