Hello,
I'm trying to use the Google Reader API for my android app and i'm
having trouble marking items as read. I'm getting 400 bad request.
Other things do work: Logging in, Getting a token, getting
subscriptions.items etc.
I'm using apache HttpClient 4. I have almost the same thing working as
a standard java application only that one uses HttpClient 3 so i had
to change it i little bit for android. But since that is working i
know a have all the parameters and headers correct.
One thing that is different from the working java version is the way
the parameters are passed in the request. In the android version it's
like this:
public String post(String pUrl, List<Parameter> pParams, boolean
pUseCookies) throws GoogleReaderException {
ArrayList<NameValuePair> postParameters =
(ArrayList<NameValuePair>) (toNameValuePairArray(pParams));
HttpPost postRequest = new HttpPost(pUrl);
try {
postRequest.setEntity(new UrlEncodedFormEntity(postParameters,
HTTP.UTF_8));
} catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
return execute(postRequest, pUseCookies);
}
Here are some details of the request and response from the android
eclipse debugger:
uri :
https://www.google.com/reader/api/0/edit-tag
postparameters(before passed to UrlEncodedFormEntity()):
[s=feed%2Fhttp%3A%2F%
2Fwww.androidworld.nl%2Ffeed%2F, i=tag
%3Agoogle.com%2C2005%3Areader%2Fitem%2F6ef6e1f6dc7771f9, T=//
vwbWgfeJ5Sc03YiQ-1D3Pw, async=true, pos=0, a=user/**********/state/
com.google/read]
headers:
[Authorization: GoogleLogin
auth=DQAAAMUAAAAIpsBx9lbuZgs9yVNX4LOiKyRCj7l6KOvuq_M8-AEoFf-
U2uqGuzSqsOU943W3bgYMalT1yZi0sQoKIwllp-
irESlqQI6jPouMhE6xn4Ut-9SYpujebFn_ICcJs1oN2dDqE1BO_Bym4jK1hKADHKebtV_k-
Dk-
UKvoCIFueOA_w_ZvDSrBcgHkIwIEpTNMYNzSYBfeytqYoyinHL75x4P8K9k9nU9mEXb0dbJVMutpuakIvQwUxBwedWTsv4iR5Q3tiRAO6iUmGPu6BnZJZ80R]
This kind of post works for login but somehow doesn't work now.
What is wrong?
Let me know if i need to post more detailed info (and what)
Thanks!