HTTPClientのインスタンスにURLと送りたいもののハッシュを渡すだけ
ファイルの添付もファイルハンドラ渡すだけ
require 'httpclient'
@c = HTTPClient.new()
res = @c.post('http://example.com', {:title => 'あああ', :image => open('path_to_file','r')})
More than 5 years have passed since last update.
HTTPClientのインスタンスにURLと送りたいもののハッシュを渡すだけ
ファイルの添付もファイルハンドラ渡すだけ
require 'httpclient'
@c = HTTPClient.new()
res = @c.post('http://example.com', {:title => 'あああ', :image => open('path_to_file','r')})
Register as a new user and use Qiita more conveniently