End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTPHeader#content_type
content_type
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.1.3/lib/net/http/header.rb, line 355
def content_type
return nil unless main_type()
if sub_type()
then "#{main_type()}/#{sub_type()}"
else main_type()
end
end
Returns a content type string such as “text/html”. This method returns nil if Content-Type: header field does not exist.
See also
#content_type=
#content_range
#content_length=
#delete
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0