instance method
media_type
Ruby on Rails 7.2.3
Since v3.0.20Signature
media_type()
The String MIME type of the request.
# get "/articles" request.media_type # => "application/x-www-form-urlencoded"
Source
# File actionpack/lib/action_dispatch/http/request.rb, line 280
def media_type
content_mime_type&.to_s
end
Defined in actionpack/lib/action_dispatch/http/request.rb line 280
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionDispatch::Request