Skip to content

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#set_range

set_range(r, e = nil)

Sets the HTTP Range: header. Accepts either a Range object as a single argument, or a beginning index and a length from that index. Example:

Example
req.range = (0..1023)
req.set_range 0, 1023
See also #set_form_data #sub_type #set_form #to_hash also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1