Class: JsonApiClient::Middleware::JsonRequest

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/json_api_client/middleware/json_request.rb

Instance Method Summary collapse

Instance Method Details

#call(environment) ⇒ Object



4
5
6
7
8
# File 'lib/json_api_client/middleware/json_request.rb', line 4

def call(environment)
  environment[:request_headers]["Content-Type"] = 'application/vnd.api+json'
  environment[:request_headers]["Accept"] = 'application/vnd.api+json'
  @app.call(environment)
end