instance method
Net::HTTPHeader#chunked?
() -> bool
chunked?
lib/net/http/header.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/net/http/header.rb, line 658
def chunked?
return false unless @header['transfer-encoding']
field = self['Transfer-Encoding']
(/(?:\A|[^\-\w])chunked(?![\-\w])/i =~ field) ? true : false
end
Returns true if field 'Transfer-Encoding' exists and has value 'chunked', false otherwise; see Transfer-Encoding response header:
Example
res = Net::HTTP.get_response(hostname, '/todos/1') res['Transfer-Encoding'] # => "chunked" res.chunked? # => true
See also
#canonical_each
#connection_close?
#basic_auth
#connection_keep_alive?
also in
4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0