我想获取json表单url:
uri = URI.parse("http://84.38.185.251:9262/send") http = Net::HTTP.new(uri.host,uri.port) request = Net::HTTP::Get.new(uri.request_uri) response = http.request(request) response.code # => 301 response.body # => The body (HTML,XML,blob,whatever) response["cache-control"] # => public,max-age=2592000 puts response.body
但我收到一个错误:`EOFError(文件结束):
app / controllers / sensors_controller.rb:35:在sensinfo’
sensors_controller.rb:35:
response = http.request(request)
我做错了什么?