to_hash

to_hash() Instance Public methods Returns a Hash consisting of header names and values. e.g. {âcache-controlâ => âprivateâ, "content-type" => "text/html", "date" => "Wed, 22 Jun 2005 22:11:50 GMT"}

sub_type

sub_type() Instance Public methods Returns a content type string such as âhtmlâ. This method returns nil if Content-Type: header field does not exist or sub-type is not given (e.g. âContent-Type: textâ).

set_range

set_range(r, e = nil) Instance Public methods 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: req.range = (0..1023) req.set_range 0, 1023 range=

set_form_data

set_form_data(params, sep = '&') Instance Public methods Set header fields and a body from HTML form data. params should be an Array of Arrays or a Hash containing HTML form data. Optional argument sep means data record separator. Values are URL encoded as necessary and the content-type is set to application/x-www-form-urlencoded Example: http.form_data = {"q" => "ruby", "lang" => "en"} http.form_data = {"q" => ["ruby", "perl"], "lang" => "en"} http.set_form_data({"

set_form

set_form(params, enctype='application/x-www-form-urlencoded', formopt={}) Instance Public methods Set a HTML form data set. params is the form data set; it is an Array of Arrays or a Hash +enctype is the type to encode the form data set. It is application/x-www-form-urlencoded or multipart/form-data. formpot is an optional hash to specify the detail. boundary the boundary of the multipart message charset the charset of the message. All names and the values of non-file fields a

set_content_type

set_content_type(type, params = {}) Instance Public methods 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'} content_type=

range_length

range_length() Instance Public methods The length of the range represented in Content-Range: header.

range=

range=(r, e = nil) Instance Public methods Alias for: set_range

range

range() Instance Public methods Returns an Array of Range objects which represent the Range: HTTP header field, or nil if there is no such header.

proxy_basic_auth

proxy_basic_auth(account, password) Instance Public methods Set Proxy-Authorization: header for âBasicâ authorization.