Sha256: f8e638fd17e4dd0de7b5195edf6e0771d55e317483aeef74df70e8290febc79d

Contents?: true

Size: 870 Bytes

Versions: 28

Compression:

Stored size: 870 Bytes

Contents

module ActionController
  class AbstractRequest
    # Determine whether the body of a HTTP call is URL-encoded (default)
    # or matches one of the registered param_parsers. 
    #
    # For backward compatibility, the post format is extracted from the
    # X-Post-Data-Format HTTP header if present.
    def post_format
      case content_type.to_s
      when 'application/xml'
        :xml
      when 'application/x-yaml'
        :yaml
      else
        :url_encoded
      end
    end

    # Is this a POST request formatted as XML or YAML?
    def formatted_post?
      post? && (post_format == :yaml || post_format == :xml)
    end

    # Is this a POST request formatted as XML?
    def xml_post?
      post? && post_format == :xml
    end

    # Is this a POST request formatted as YAML?
    def yaml_post?
      post? && post_format == :yaml
    end
  end
end

Version data entries

28 entries across 28 versions & 4 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/actionpack/lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.1 lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.0 lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.2 lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.3 lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.4 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.0 lib/action_controller/deprecated_request_methods.rb
actionpack-1.12.5 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.6 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.1 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.3 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.2 lib/action_controller/deprecated_request_methods.rb
actionpack-1.13.4 lib/action_controller/deprecated_request_methods.rb