Class: Restforce::DB::Middleware::StoreRequestBody

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/restforce/db/middleware/store_request_body.rb

Overview

Public: A Faraday middleware to store the request body in the environment.

This works around an issue with Faraday where the request body is squashed by the response body, once a request has been made.

See also:

Instance Method Summary collapse

Instance Method Details

#call(request_env) ⇒ Object

Public: Executes this middleware.

request_env - The request’s Env from Faraday.



20
21
22
23
# File 'lib/restforce/db/middleware/store_request_body.rb', line 20

def call(request_env)
  request_env[:request_body] = request_env[:body]
  @app.call(request_env)
end