注册

我为啥获取token返回400错误,用户注册都可以?求助~

我参考获取token的文档来写的,获取token;
我的方法:
String content = "{\"grant_type\":\"client_credentials\",\"client_id”:\"YXA6xdoZIANQEeWix1fjFvDbug\",\"client_secret\":\"YXA6mQzq2AZEPPa2d4fZSE5vDr25YP0\"}";
String sr=HttpRequest.sendPost("https://a1.easemob.com/wazert/wazerthnt/token", content);
**.out.println(sr);
返回:
java.io.IOException: Server returned HTTP response code: 400 for URL: https://a1.easemob.com/wazert/wazerthnt/token

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1305)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getInputStream(HttpsURLConnectionImpl.java:234)
at com.wazert.huanxin.HttpRequest.sendPost(HttpRequest.java:101)
at com.wazert.huanxin.Test.main(Test.java:20)

我确定content中的内容都写好的,都是对的,我今天对了一下午了;
我用的注册:
String user = "{\"username\":\"18667179666\",\"password\":\"18667179666\", \"nickname\":\"zhaozhuo\"}";
String sr=HttpRequest.sendPost("https://a1.easemob.com/wazert/wazerthnt/users", user );
**.out.println(sr);
都是可以的;


已邀请:

beyond - imgeek运营

参考java demo https://github.com/easemob/emchat-server-examples
> forum.php?mod=redirect&goto=findpost&pid=3516&ptid=1664
参考java demo https://github.com/easemob/emchat-server-examples


thanks very mach~

要回复问题请先登录注册