Я занимаюсь разработкой про Google Reader на платформе Android.Google reader api mark as read return 411 error (с помощью java on android)
Используя google reader api, я могу успешно получить список RSS. Но когда я хочу пометить элемент RSS как прочитанный, я получил ошибку «411 Length». Это мой код:
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(
"http://www.google.com/reader/api/0/edit-tag");
httppost.addHeader("Authorization", auth);
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("i", itemId));
nameValuePairs.add(new BasicNameValuePair("a",
"user/-/state/com.google/read"));
nameValuePairs.add(new BasicNameValuePair("async", "true"));
nameValuePairs.add(new BasicNameValuePair("T", token));
nameValuePairs.add(new BasicNameValuePair("s", feedUrl));
try {
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
Toast.makeText(getApplicationContext(),
EntityUtils.toString(response.getEntity()),
Toast.LENGTH_LONG).show();
} catch (UnsupportedEncodingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Есть ли что-то неправильно?