class Faraday::Request::Json
def body?(env)
def body?(env) body = env[:body] case body when true, false true when nil # NOTE: nil can be converted to `"null"`, but this middleware doesn't process `nil` for the compatibility. false else !(body.respond_to?(:to_str) && body.empty?) end end