服务端发送消息 > Ruby
杭州: rest-hangzhou.goeasy.io
新加坡: rest-singapore.goeasy.io
http(s)://<REST Host>/publish
Post
名称 | 必要 | 描述 |
---|---|---|
appkey | 是 | 您的appkey |
channel | 是 | channel |
content | 是 | 您要发送的消息内容 |
{
"code" : 200,
"content" : "OK"
}
返回值的详细说明,请参考附录A。
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