APIdock / Ruby on Rails
/
Browse About
method

content_type

v2.2.1 - Show latest stable - Class: ActionController::AbstractRequest
content_type()
public

The MIME type of the HTTP request, such as Mime::XML.

For backward compatibility, the post \format is extracted from the X-Post-Data-Format HTTP header if present.

# File actionpack/lib/action_controller/request.rb, line 87
    def content_type
      Mime::Type.lookup(content_type_without_parameters)
    end

Related methods

  • Instance methods
  • accepts
  • body
  • body_stream
  • cache_format
  • content_length
  • content_type
  • cookies
  • delete?
  • domain
  • etag_matches?
  • format
  • format=
  • fresh?
  • get?
  • head?
  • headers
  • host
  • host_with_port
  • if_modified_since
  • if_none_match
  • method
  • not_modified?
  • parameters
  • path
  • path_parameters
  • path_parameters=
  • port
  • port_string
  • post?
  • protocol
  • put?
  • query_parameters
  • query_string
  • raw_host_with_port
  • raw_post
  • referer
  • referrer
  • remote_addr
  • remote_ip
  • request_method
  • request_parameters
  • request_uri
  • reset_session
  • server_software
  • session
  • session=
  • ssl?
  • standard_port
  • subdomains
  • symbolized_path_parameters
  • template_format
  • url
  • xhr?
  • xml_http_request?
  • Class methods
  • relative_url_root=
  • Protected methods
  • protectedcontent_type_with_parameters
  • protectedcontent_type_without_parameters
  • Private methods
  • privateclean_up_ajax_request_body!
  • privateextract_content_type_without_parameters
  • privateextract_multipart_boundary
  • privateget_typed_value
  • privateparse_multipart_form_parameters
  • privateparse_query_parameters
  • privateparse_request_parameters
  • privateread_multipart
  • privatecontent_type_from_legacy_post_data_format_header
  • privatenamed_host?
  • privateparse_formatted_request_parameters
APIdock API Documentation Browser

© 2026 APIdock