require 'net/http' url = URI.parse('http://localhost:3000/products') Net::HTTP.start(url.host, url.port) do |http| req = Net::HTTP::Post.new(url.path) req.set_form_data( 'name' => 'David' ) req.basic_auth('username', 'password') puts http.request(req).body end ruby 这个文件在服务器端看到 Started POST "/products" for 127.0.0.1 at 2013-02-26 14:33:42 +0800 Processing by ProductsController#create as / Parameters: {"name"=>"David"} WARNING: Can't verify CSRF token authenticity (0.6ms) begin transaction (0.1ms) rollback transaction
利用这个程序可以在服务器段看有数据传过来,但是不能存到数据库里,怎么办,help