Well, I have already login and get the authorizatioin token key. When
I use this key to get a private album list, the server response 404
Not Found error.

Here is my code:

private HttpConnection httpConnection = null;
private InputStream is = null;

//Client login
String url = "https://www.google.com/accounts/ClientLogin?
accountType=HOSTED_OR_GOOGLE&email=dongfuyuan8...@gmail.com&Passwd=***&service=lh2&source=SEMC-
Picasa-0.0.";
try {
        httpConnection = (HttpConnection)Connector.open(url,
Connector.READ_WRITE);
        httpConnection.setRequestMethod(HttpConnection.POST);
        httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-2.1
Configuration/CLDC-1.1");
        httpConnection.setRequestProperty("Content-Type", "application/x-www-
form-urlencoded");
        int responseCode = httpConnection.getResponseCode();
        String responseMessage = httpConnection.getResponseMessage();
        System.out.println("responseCode: "+responseCode);
        System.out.println("responseMessage: "+responseMessage);
        is = httpConnection.openInputStream();
        getResponseMessage(is);
} catch (IOException e) {
        e.printStackTrace();
}

//get the auth token key
String auth = message.substring(message.indexOf("Auth") + 5);

//get album list
url =
try {
        httpConnection = (HttpConnection) Connector.open(url,
Connector.READ_WRITE);
        httpConnection.setRequestMethod(HttpConnection.GET);
        httpConnection.setRequestProperty("User-Agent", "Profile/MIDP-2.1
Configuration/CLDC-1.1");
        httpConnection.setRequestProperty("Content-Type", "application/atom
+xml");
        httpConnection.setRequestProperty("Authorization", "GoogleLogin
auth="+auth);

        System.out.println("[debug]"+httpConnection.getResponseCode());
        System.out.println("[debug]"+httpConnection.getResponseMessage());
        
System.out.println("[debug]"+httpConnection.getRequestProperty("Authorization"));

        is = httpConnection.openInputStream();
        getResponseMessage(is);
} catch (IOException e) {
        e.printStackTrace();
}

But, the response is 404 not found.
Any help on why I get this error and how to solve it would be very
much appreciated.


Best regards

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To post to this group, send email to google-picasa-data-...@googlegroups.com.
To unsubscribe from this group, send email to 
google-picasa-data-api+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-picasa-data-api?hl=en.

Reply via email to