Sha256: 517668ad14291d6ee06461efe062075b0d94aa36892597d151428f439ac721b0
Contents?: true
Size: 512 Bytes
Versions: 12
Compression:
Stored size: 512 Bytes
Contents
module Faraday class Request::ActiveSupportJson < Faraday::Middleware begin if !defined?(ActiveSupport::JSON) require 'active_support' ActiveSupport::JSON end rescue LoadError, NameError => e self.load_error = e end def call(env) env[:request_headers]['Content-Type'] = 'application/json' if env[:body] && !env[:body].respond_to?(:to_str) env[:body] = ActiveSupport::JSON.encode env[:body] end @app.call env end end end
Version data entries
12 entries across 12 versions & 1 rubygems