2013-04-23 129 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