Here is the code I am attempting to execute when I get the 404. The
ClientLoginResponse holds the valid auth token I receive from the
ClientLogin request.
private static final String DOCUMENTS_BASE_URL = "http://
docs.google.com/feeds/documents/private/full";
try {
final HttpClient client = new DefaultHttpClient();
final HttpParams params = client.getParams();
HttpConnectionParams.setConnectionTimeout(params,
CONNECTION_TIMEOUT);
HttpConnectionParams.setSoTimeout(params,
CONNECTION_TIMEOUT);
StringBuilder url = new StringBuilder(DOCUMENTS_BASE_URL);
Log.i("DocumentList", url.toString());
HttpGet method = new HttpGet(url.toString());
//method.setHeader("Content-type", "application/x-www-form-
urlencoded");
method.setHeader("GData-Version", "2.0");
method.setHeader("Authorization", "GoogleLogin
auth="+login.getAuthToken());
HttpResponse httpResp = client.execute(method);
HttpEntity httpEntity = httpResp.getEntity();
StatusLine status = httpResp.getStatusLine();
switch(status.getStatusCode()) {
default:
case 200:
{
String response =
EntityUtils.toString(httpEntity);
httpEntity.consumeContent();
Log.i("DocumentList", response);
}
break;
case 403:
{
Log.i("DocumentList", "Request Failed");
}
}
}
catch(IOException e) {
}
On Jul 8, 1:19 am, Mooretis <[email protected]> wrote:
> I am attempting to integrate with Google Docs. (At the moment just
> trying to get a list of documents). I have issued the ClientLogin
> request and get an authorization token. But when I then hit
> thehttp://docs.google.com/feeds/documents/private/fullwith my
> authorization key in the headers, I get a page not found. I can tell
> the authorization key is working because if I do not pass that header,
> I get a 403 instead.
>
> Any reason why I would be getting a page not found? I am lost and not
> sure what else to try. I am not using the java client libraries
> since I am running on Android and want to keep it lightweight.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---