首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Google Code Issue Tracker API帮助

Google Code Issue Tracker API帮助
EN

Stack Overflow用户
提问于 2010-09-19 11:24:03
回答 1查看 447关注 0票数 1

长话短说:我正试图通过一个名为Abugadro的Android应用程序在Google Code上发表评论并制造问题。

我遵循了一段非常相似的代码:Google Spreadsheet API update \ edit with protocol

当我试图在API上发布评论时,根据我使用的头部,我得到了各种错误,比如403和501。

无论如何,代码会说话,所以这是我的文章:

代码语言:javascript
复制
HttpPost postRequest = new HttpPost("http://code.google.com/feeds/issues/p/"+projName+"/issues/"+issueId+"/comments/full");

postRequest.addHeader("Content-Type","application/atom+xml;charset=UTF-8");
postRequest.setHeader("Authorization", "GoogleLogin auth=" + auth);
postRequest.addHeader("User-Agent", "abugadro-v"+getResources().getString(R.string.version));
postRequest.addHeader("Accept-Encoding","gzip");
postRequest.addHeader("GData-Version", "1.0");
//postRequest.addHeader("If-Match", "*");//Not entirely sure if I should use this or not

HttpEntity se = new StringEntity(xml,"UTF-8"); //Contains the comment info              
postRequest.setEntity(se);

IssueTrackerAPI对于我应该使用哪种报头来正确发布内容非常含糊。http://code.google.com/p/support/wiki/IssueTrackerAPI#Modifying_an_issue_or_creating_issue_comments

附注:我知道有一个gdata-java-client,但是在android上使用这个api时,如果不拖拽大约2MB的jars是不可能的。

我真的很感谢你的帮助,这个问题已经让我疯狂到无法理解的地步。再次感谢。

EN

回答 1

Stack Overflow用户

发布于 2010-09-24 10:00:45

对于Google API来说,最好的安卓库是google-api-java-client,它支持安卓。gdata-java-client不支持安卓。

google-api-java-client支持Issue Tracker API,但目前还没有示例。请使用make a request for a sample。同时,你可以看看其他一些为安卓编写的例子,比如picasa-atom-android-samplecalendar-v2-atom-android-sample

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3744415

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档