2013-04-23 54 views
0

我要讓HTTPGET通過Android應用程序的請求,安卓:調用HTTPGET與REDIRECT_URI

URL = https://www.facebook.com/dialog/oauth?client_id=<number>&redirect_uri=<SOME_URL>&scope=email 

上面的網址工作正常使用的瀏覽器,它給我正確的結果在服務器端,但是當我提出HTTP調用從應用程序它不會工作,得到了200響應,但它不會給我結果。

代碼片段:

HttpParams httpParams = new BasicHttpParams(); 
    httpParams.setParameter(CoreProtocolPNames.PROTOCOL_VERSION,      HttpVersion.HTTP_1_1); 
    HttpConnectionParams.setConnectionTimeout(httpParams, 
          CONN_TIMEOUT); 
    HttpGet httpGet = new HttpGet(URL); 
    Log.d(TAG,"URL :"+ httpGet.getURI().toURL().toString());    
    DefaultHttpClient client = new DefaultHttpClient(httpParams); 

    HttpResponse httpResponse = client.execute(httpGet);    

    //Log.d(TAG,"httpResponse :" +EntityUtils.toString(httpResponse.getEntity())); 
    res = httpResponse.getStatusLine().getStatusCode(); 
    Log.d(TAG, "Response : " + res); 

回答

0

這是因爲

200 response code "OK" 
The request has succeeded. The information returned with the response is dependent on the method used in the request,if there is some result request code will 204 
+0

能否請您解釋一下,什麼是錯的? – Nimit 2013-04-23 04:53:12

+0

@Nimit你需要檢查你的網址可能不正確,只用於發佈而不是獲得可能是 – DjHacktorReborn 2013-04-23 04:55:51

+0

我試過httpPost,但同樣的問題。 – Nimit 2013-04-23 04:57:50