我有一个订阅者客户端连接到https://pubsubhubbub.appspot.com/subscribe我把参数放在
下面https://pubsubhubbub.appspot.com/subscribe
hub.topic http://...../lastupby
hub.callback http://localhost:8080/Subscription/subscription/subscribe
hub.mode subscribe
但是我得到了无响应我无法理解这是什么问题谢谢你的帮助
HttpPost httppost = new HttpPost(hub);
List<NameValuePair> nvps = new ArrayList<NameValuePair>();
nvps.add(new BasicNameValuePair("hub.callback", callbackUrl));
nvps.add(new BasicNameValuePair("hub.mode", "subscribe"));
nvps.add(new BasicNameValuePair("hub.topic", topic_url));
nvps.add(new BasicNameValuePair("hub.verify", "sync"));
if (lease_seconds != null)
nvps.add(new BasicNameValuePair("hub.lease_seconds", lease_seconds));
//For future https implementation
//if ((secret !=null) && (secret.getBytes("utf8").length < 200))
// nvps.add(new BasicNameValuePair("hub.hub.secret", secret));
if (verifytoken !=null)
nvps.add(new BasicNameValuePair("hub.verify_token", verifytoken));
webserver.addAction("subscribe",topic_url, verifytoken);
httppost.setEntity(new UrlEncodedFormEntity(nvps));
httppost.setHeader("Content-type", "application/x-www-form-urlencoded");
httppost.setHeader("User-agent", "RSS pubsubhubbub 0.3");
//create the thread and start it running
GetThread thread = new GetThread(httpClient, httppost);
thread.start();
thread.join();
谢谢
答案 0 :(得分:1)
你要检查的第一件事是响应的HTTP状态,然后检查正文本身,可能包括你做错了什么。
另外,根据您的示例,我几乎可以确定问题与您的回调网址有关。当您向集线器发送订阅请求时,集线器需要与您核对您想要此订阅。然后它会向您的回调网址发送请求(请检查规范中的意图部分验证)。由于您的回调确实在防火墙后面,因此集线器永远无法访问它。