post(url, data, header = nil)
public
Posts data to the specified URI object.
Example:
require 'net/http'
require 'uri'
Net::HTTP.post URI('http://www.example.com/api/search'),
{ "q" => "ruby", "max" => "50" }.to_json,
"Content-Type" => "application/json"
Show source
def HTTP.post(url, data, header = nil)
start(url.hostname, url.port,
:use_ssl => url.scheme == 'https' ) {|http|
http.post(url, data, header)
}
end