服务端发送消息 > Java
杭州: rest-hangzhou.goeasy.io
新加坡: rest-singapore.goeasy.io
http(s)://<REST Host>/publish
Post
名称 | 必要 | 描述 |
---|---|---|
appkey | 是 | 您的appkey |
channel | 是 | channel |
content | 是 | 您要发送的消息内容 |
{
"code" : 200,
"content" : "OK"
}
返回值的详细说明,请参考附录A。
下载依赖包: gson-2.3.1.jar, slf4j-api-1.7.2.jar
添加goeasy添加到您的pom.xml文件:
<dependencies>
...
<dependency>
<groupId>io.goeasy</groupId>
<artifactId>goeasy-sdk</artifactId>
<version>0.3.16</version>
</dependency>
</dependencies>
GoEasy goEasy = new GoEasy( "http(s)://<REST Host>”, "my_appkey");
goEasy.publish("my_channel", "Hello, GoEasy!");