Facebook

12 views
Skip to first unread message

vinh tran

unread,
Mar 18, 2011, 3:58:56 AM3/18/11
to Google App Engine
code

public static String fetchURL(String authURL) {
String retStr = "";
try {
URLFetchService fetch =
URLFetchServiceFactory.getURLFetchService();
URL url = new URL(authURL);
FetchOptions options =
FetchOptions.Builder.doNotValidateCertificate();
HTTPRequest httpRequest = new HTTPRequest(url,
HTTPMethod.GET,options);
HTTPResponse response = fetch.fetch(httpRequest);
retStr = new String(response.getContent());
} catch (Exception e) {
e.printStackTrace();
}
return retStr;
}




java.lang.IllegalArgumentException: Invalid uri 'https://
graph.facebook.com/oauth/access_token?
client_id=136699949732681&redirect_uri=http://localhost:8888/
authentication/
&client_secret=6a94058469da544b8c690688fae4e356&code=2.W5JkpTjfPqlKzSWIwtjnnQ__.
3600.1300438800-100001913980406|L1SJxORQTNnMI8a8dN4YheG3lvQ': Invalid
query
at org.apache.commons.httpclient.HttpMethodBase.<init>(Unknown
Source)
at org.apache.commons.httpclient.methods.GetMethod.<init>(Unknown
Source)
at com.google.appengine.api.urlfetch.dev.LocalURLFetchService
$1.buildMethod(LocalURLFetchService.java:94)
at
com.google.appengine.api.urlfetch.dev.LocalURLFetchService.fetch(LocalURLFetchService.java:
233)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$AsyncApiCall.callInternal(ApiProxyLocalImpl.java:398)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$AsyncApiCall.call(ApiProxyLocalImpl.java:364)
at com.google.appengine.tools.development.ApiProxyLocalImpl
$AsyncApiCall.call(ApiProxyLocalImpl.java:343)
at java.util.concurrent.Executors$PrivilegedCallable$1.run(Unknown
Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.concurrent.Executors$PrivilegedCallable.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


Reply all
Reply to author
Forward
0 new messages