method
post_form
post_form(url, params)
public
Posts HTML form data to the specified URI object. The form data must be provided as a Hash mapping from String to String. Example:
{ "cmd" => "search", "q" => "ruby", "max" => "50" }
This method also does Basic Authentication iff url.user exists. But userinfo for authentication is deprecated (RFC3986). So this feature will be removed.
Example:
require 'net/http' require 'uri' Net::HTTP.post_form URI('http://www.example.com/search.cgi'), { "q" => "ruby", "max" => "50" }