0
當我試圖執行以下代碼`encode_www_form ':未定義的方法`地圖'
require "net/http"
require "uri"
@appArgs = Array.new
@vmip_and_port = "yyyyy"
def post(url, data)
uri = URI.parse(url)
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Post.new(uri.request_uri)
request.set_form_data(data)
response = http.request(request)
return response
end
def click_inapp(id)
@appArgs.push(id)
return
end
def finish_inapp()
data = @appArgs.join(",")
res = post("http://" [email protected]_and_port+"/", data)
return res.body
end
click_inapp("5X7_photo_paper.png")
click_inapp("4X6_photo_paper.png")
finish_inapp()
正在逐漸
uri/common.rb:931:in `encode_www_form': undefined method `map' for "5X7_photo_paper.png,4X6_photo_paper.png":String (NoMethodError)
from /home/ushusadmin/.rvm/rubies/ruby-1.9.3-p448/lib/ruby/1.9.1/net/http.rb:1761:in `set_form_data'
from app_utilities.rb:11:in `post'
from app_utilities.rb:23:in `finish_inapp'
from app_utilities.rb:28:in `<main>'
什麼毛病我code.please corect我
:-) thanks yooooooo – Sush