require "net/http" require "uri" require "json" uri = "http://192.168.1.11/cgi-bin/index.rb?ctrl=data_post" data = {pressure: 1013.12345, temperature: 25.567} res = Net::HTTP.post_form(URI.parse(uri), {"data"=>data.to_json}) puts res.body