lib/elastic/transport/transport/http/faraday.rb in elastic-transport-8.0.0.pre1 vs lib/elastic/transport/transport/http/faraday.rb in elastic-transport-8.0.0.pre2
- old
+ new
@@ -41,15 +41,19 @@
connection.connection.headers
end
else
headers
end
+ body = body ? __convert_to_json(body) : nil
+ body, headers = compress_request(body, headers)
- response = connection.connection.run_request(method.downcase.to_sym,
- url,
- ( body ? __convert_to_json(body) : nil ),
- headers)
+ response = connection.connection.run_request(
+ method.downcase.to_sym,
+ url,
+ body,
+ headers
+ )
Response.new response.status, decompress_response(response.body), response.headers
end
end
@@ -58,10 +62,10 @@
# @return [Connections::Connection]
#
def __build_connection(host, options={}, block=nil)
client = ::Faraday.new(__full_url(host), options, &block)
apply_headers(client, options)
- Connections::Connection.new :host => host, :connection => client
+ Connections::Connection.new(host: host, connection: client)
end
# Returns an array of implementation specific connection errors.
#
# @return [Array]