访问Google云消息时IO异常? [英] IO Exception while accessing Google Cloud message?
问题描述
我已经在服务器和Android上编写了GCM的代码。我已经成功地获得了注册ID。但是我无法注册到GCM,同时在注册时显示IO异常。我已经使用了 Android hive教程为此。我有gmail id和我的注册ID并且还创建了一个Url来发布。任何想法请与我分享。提前感谢
I have written the code for GCM both in server and Android. I am getting the Registration ID successfully.But I am not able to register to GCM,while making a post to register it shows an IO exception.I have used Android hive tutorial for this.I have gmail id and registration id with me and also created a Url to post.Any idea please share with me.Thanks in advance
推荐答案
这些代码行创建例外:
These are the line of code that creates the exception:
int status = conn.getResponseCode();
if (status != 200) {
throw new IOException("Post failed with error code " + status);
基本上这个方法负责向服务器发送POST请求。您是否在客户端应用程序中正确配置了端点URL?
Basically this methods is responsible for sending a POST request to the server. Have you configured the endpoint URL correctly in the client app?
编辑:状态码302为找到:请求的资源暂时位于不同的URI下。
详情请点击此处 http://www.w3.org /Protocols/rfc2616/rfc2616-sec10.html
The status code 302 is "Found: The requested resource resides temporarily under a different URI." See here for more info: http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
这篇关于访问Google云消息时IO异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!