我有一個連接到https://pubsubhubbub.appspot.com/subscribe我把參數如下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();
謝謝
你得到了什麼錯誤/異常? – 2011-12-20 06:54:57
當我嘗試獲取System.out.println(「thread.httpresponse」+ thread.httpresponse.getStatusLine()。getReasonPhrase())響應代碼時,我沒有得到任何錯誤;它返回空///我們在代理後面工作,是否會導致這種情況?我不知道 – 2011-12-20 08:53:22