Method: Elasticsearch::Transport::Client#perform_request

Defined in:
lib/elasticsearch/transport/client.rb

#perform_request(method, path, params = {}, body = nil, headers = nil) ⇒ Object

Performs a request through delegation to #transport.



189
190
191
192
193
194
195
196
197
198
# File 'lib/elasticsearch/transport/client.rb', line 189

def perform_request(method, path, params = {}, body = nil, headers = nil)
  method = @send_get_body_as if 'GET' == method && body
  if (opaque_id = params.delete(:opaque_id))
    headers = {} if headers.nil?
    opaque_id = @opaque_id_prefix ? "#{@opaque_id_prefix}#{opaque_id}" : opaque_id
    headers.merge!('X-Opaque-Id' => opaque_id)
  end
  validate_ca_fingerprints if @ca_fingerprint
  transport.perform_request(method, path, params, body, headers)
end