Sha256: 622d89a598a501ab22f9a4ee930935b2f2ddaf53b5264c620bbbda1dfa97b8f0
Contents?: true
Size: 348 Bytes
Versions: 25
Compression:
Stored size: 348 Bytes
Contents
module JsonApiClient module Middleware class JsonRequest < Faraday::Middleware def call(environment) environment[:request_headers]["Accept"] = "application/json,*/*" uri = environment[:url] uri.path = uri.path + ".json" unless uri.path.match(/\.json$/) @app.call(environment) end end end end
Version data entries
25 entries across 25 versions & 1 rubygems