Class: Eson::HTTP::Request::GetHackMiddleware

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/eson/http/request.rb

Overview

This middleware circumvents faradays detection of :get as special and emits a generic request - which can have a body… This is mostly due to ElasticSearchs reliance of Bodys on get and delete.

Instance Method Summary collapse

Instance Method Details

#call(env) ⇒ Object



16
17
18
19
20
# File 'lib/eson/http/request.rb', line 16

def call(env)
  env[:method] = "get" if env[:method] == :get

  @app.call env
end