method

post_form

v1_8_7_330 - Show latest stable - Class: Net::HTTP
post_form(url, params)
public

Posts HTML form data to the URL. Form data must be represented as a Hash of String to String, e.g:

{ "cmd" => "search", "q" => "ruby", "max" => "50" }

This method also does Basic Authentication iff URL.user exists.

Example:

require 'net/http'
require 'uri'

HTTP.post_form URI.parse('http://www.example.com/search.cgi'),
               { "q" => "ruby", "max" => "50" }