Sha256: 57d0a62cbe2d8521fad67abb12a2b974b84f159c776d8a3fd15c25d9425e7dff

Contents?: true

Size: 425 Bytes

Versions: 41

Compression:

Stored size: 425 Bytes

Contents

module Pliny::Helpers
  module Params
    def body_params
      @body_params ||= parse_body_params
    end

    private

    def parse_body_params
      if request.media_type == "application/json"
        p = indifferent_params(MultiJson.decode(request.body.read))
        request.body.rewind
        p
      elsif request.form_data?
        indifferent_params(request.POST)
      else
        {}
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 1 rubygems

Version Path
pliny-0.6.3 lib/pliny/helpers/params.rb