Skip to content

Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →

instance method

Net::HTTPGenericRequest#response_body_permitted?

() -> bool
response_body_permitted?

Returns whether the response may have a body:

Example
Net::HTTP::Post.new(uri).response_body_permitted? # => true
Net::HTTP::Head.new(uri).response_body_permitted? # => false
See also #request_body_permitted? #pretty_print also in 4.0 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0