인증 GReader 편집 API에 문제가 있습니다. 인증을 위해 HTTPS (https://www.google.com/accounts/ClientLogin)를 할 수 있으며 Google은 세 개의 토큰 (SID, LSID, AUTH)을 반환하지만 HSID는 반환하지 않습니다. Google 리더 수정 API 인증 문제
내가 쿠키에 HSID없이/POST 데이터 T = djj72HsnLS8293 & quickadd = blog.martindoms.com/피드에 새 피드 http://www.google.com/reader/api/0/subscription/quickadd?ck=1290452912454&client=scroll를 추가하려고
는, 모든 것이 제대로 작동 쿠키의 SID와 HSID으로 응답 상태 코드 (401)입니다.이 HSID 문자열은 어디에서 찾을 수 있습니까?
귀하의 답변을위한 탁아.
내 코드 : 당신이 참조로 된 정보를 사용하고있을 수 있습니다처럼
public void addNewFeed() throws IOException {
HttpPost requestPost = new HttpPost("http://www.google.com/reader/api/0/subscription/quickadd?ck=1290452912454&client=scroll");
getSid();
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
DefaultHttpClient client = new DefaultHttpClient();
requestPost.addHeader("Cookie", "SID=" + _sid + "; HSID=" + _hsid);
try {
nameValuePairs.add(new BasicNameValuePair("T", _token));
nameValuePairs.add(new BasicNameValuePair("quickadd", "blog.martindoms.com/feed/"));
requestPost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = client.execute(requestPost);
InputStream in = response.getEntity().getContent();
BufferedReader reader = new BufferedReader(new InputStreamReader(in));
StringBuilder str = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
str.append(line + "\n");
}
System.out.println(str.toString());
in.close();
} catch (Exception ex) {
ex.printStackTrace();
}
}