Sha256: 4a40671d75ebb03679abbc371b1cec1e7542f23db5db2128ab37fff37a354b6b
Contents?: true
Size: 399 Bytes
Versions: 19
Compression:
Stored size: 399 Bytes
Contents
# frozen_string_literal: true module FinAppsCore module Middleware # This middleware sets the Accept request-header field to specify JSON as acceptable media type for the response. class AcceptJson < Faraday::Middleware KEY = 'Accept' unless defined? KEY def call(env) env[:request_headers][KEY] = 'application/json' @app.call(env) end end end end
Version data entries
19 entries across 19 versions & 1 rubygems