Skip to content

Instantly share code, notes, and snippets.

@humboldt
Forked from GOROman/ThetaStartSession.rb
Created October 7, 2018 22:01
Show Gist options
  • Save humboldt/bec21151cc2a71e00bafce71d46d88d4 to your computer and use it in GitHub Desktop.
Save humboldt/bec21151cc2a71e00bafce71d46d88d4 to your computer and use it in GitHub Desktop.
RubyでTHETA Sへセッションを貼るだけの例
require 'net/http'
HOST = '192.168.1.1'
PORT = 80
Net::HTTP.start(HOST, PORT) do |http|
req = Net::HTTP::Post.new '/osc/commands/execute'
req.body = <<EOF
{
"name": "camera.startSession",
"parameters": {}
}
EOF
# POSTする
res = http.request req
# 結果を見る
puts res.body
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment