Long story short: I'm trying to post comments and create issues onto Google Code via an Android App called Abugadro.
I followed a very similar piece of code here: http://stackoverflow.com/questions/3254330/google-spreadsheet-api-update-edit-with-protocol
When trying to post a comment onto the API, I've gotten various errors like 403 and 501 depending on the headers I use.
Anyway, Code talks, so here's my piece:
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);
The IssueTrackerAPI is very vague on what sort of headers I should be using to post correctly. http://code.google.com/p/support/wiki/IssueTrackerAPI#Modifying_an_issue_or_creating_issue_comments
P.S. I know there's a gdata-java-client but there's no sane way to use that api on android without dragging ~2mb of jars.
I really appreciate your help, this issue has been driving me insane beyond comprehension. Thanks again.