Ruby发送Websocket消息 - GoEasy PubSub

本节内容为Ruby实现GoEasy Rest接口发送消息, 使用时,可参阅Rest接口的详细介绍

Ruby

require 'net/http'

class GoEasyClient
  def self.send(channel, content)
    Thread.new {
      Net::HTTP.post_form(URI("http(s)://<REST Host>/publish"),
       {appkey: "BC-xxxxxxxxx", channel: channel, content: content})
    }
  end
end

REST Host

杭州: rest-hangzhou.goeasy.io
新加坡: rest-singapore.goeasy.io

results matching ""

    No results matching ""