End of Life Ruby 3.0 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTPHeader#content_type=
content_type=(type, params = {})
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.0.5/lib/net/http/header.rb, line 397
def set_content_type(type, params = {})
@header['content-type'] = [type + params.map{|k,v|"; #{k}=#{v}"}.join('')]
end
Alias of #set_content_type
Sets the content type in an HTTP header. The type should be a full HTTP content type, e.g. “text/html”. The params are an optional Hash of parameters to add after the content type, e.g. {‘charset’ => ‘iso-8859-1’}
See also
#set_content_type
#content_type
#delete
#content_range
also in
4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1