def set_form_data(params, sep = '&')
    query = URI.encode_www_form(params)
    query.gsub!(/&/, sep) if sep != '&'
    self.body = query
    self.content_type = 'application/x-www-form-urlencoded'
  end
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({"q" => "ruby", "lang" => "en"}, ';')