Rest接口服务端发送 - PubSub(Websocket)
RESTful API
URL:
POST http(s)://rest-hz.goeasy.io/v2/pubsub/publish //新加坡区域host为: rest-singapore.goeasy.io
JSON格式请求体
{
appkey: "您的appkey", //必填,您的appkey
channel: "test_channel", //必填,channel
content: "hello, GoEasy!", //必填,您要发送的消息内容
}
参数:
名称 | 必要 | 描述 |
---|---|---|
appkey | 是 | 您的appkey |
channel | 是 | channel |
content | 是 | 您要发送的消息内容 |
请求示例
curl -X POST https://rest-hz.goeasy.io/v2/pubsub/publish \\
-H "Content-Type: application/json" \\
-d "{
'appkey':'您的appkey',
'channel':'test_channel',
'content':'Hello, GoEasy!'
}"
返回值:
{
"code" : 200,
"content" : "OK"
}