method

parse_formatted_parameters

Importance_0
Ruby on Rails latest stable (v7.1.3.2) - 0 notes - Class: ActionDispatch::ParamsParser

Method deprecated or moved

This method is deprecated or moved on the latest stable version. The last existing version (v4.2.9) is shown here.

These similar methods exist in v7.1.3.2:

parse_formatted_parameters(env) private

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File actionpack/lib/action_dispatch/middleware/params_parser.rb, line 31
      def parse_formatted_parameters(env)
        request = Request.new(env)

        return false if request.content_length.zero?

        strategy = @parsers[request.content_mime_type]

        return false unless strategy

        case strategy
        when Proc
          strategy.call(request.raw_post)
        when :json
          data = ActiveSupport::JSON.decode(request.raw_post)
          data = {:_json => data} unless data.is_a?(Hash)
          Request::Utils.deep_munge(data).with_indifferent_access
        else
          false
        end
      rescue => e # JSON or Ruby code block errors
        logger(env).debug "Error occurred while parsing request parameters.\nContents:\n\n#{request.raw_post}"

        raise ParseError.new(e.message, e)
      end
Register or log in to add new notes.