Ok,
I've reverse engineered the Java API up to a point.
I changed my headers to:
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("GData-Version", "1.0");
And get various errors, 400 and 401 mostly. I noticed the Java API uses GZip
to send the data, is it really obligatory?
Thanks for your time.
On Sun, Sep 19, 2010 at 11:59 AM, Juan M. Rodriguez <[email protected]>wrote:
> Hey Ben,
>
> I'm using the reference. The IssueTrackerAPIJava isn't really optimized for
> Android and would drag ~6mb of dependencies to an otherwise small apk. I'm
> currently just stuck at the comment-posting part. I've no idea what could be
> the problem, but I'm fairly certain its a headers issue, either it doesn't
> like how I'm sending the XML or it's something else.
>
> Thanks.
>
>
> On Sun, Sep 19, 2010 at 9:01 AM, Ben Collins-Sussman
> <[email protected]>wrote:
>
>> Just a side question: are you using the official java library for
>> accessing the issue tracker's gdata?
>> (http://code.google.com/p/support/wiki/IssueTrackerAPIJava)?
>>
>> On Sat, Sep 18, 2010 at 11:15 PM, Nushio <[email protected]> wrote:
>> > Long story short: I'm working on an Android App that will let
>> > developers have access to their Google Code projects in a mobile
>> > friendly package. I'm trying to get commenting and creating issues
>> > from the Android device working, but I haven't found a way to do so.
>> >
>> > I keep getting different errors, 403, 501. I'm frankly tired,
>> > exhausted and out of ideas.
>> >
>> > My relevant piece of code:
>> >
>> > String xml =
>> > "<?xml version='1.0' encoding='UTF-8'?>" +
>> > "<entry xmlns='http://www.w3.org/2005/Atom' " +
>> > "xmlns:issues='http://schemas.google.com/projecthosting/issues/
>> > 2009'>"+
>> > "<content type='html'>"+((EditText)
>> > textEntryView.findViewById(R.id.comment_edit)).getText().toString()+"</
>> > content>"+
>> > "</entry>";
>> >
>> > StringEntity se = new StringEntity(xml,"UTF-8");
>> > se.setContentType("application/atom+xml");
>> >
>> > HttpPost postRequest = new HttpPost("http://code.google.com/feeds/
>> > issues/p/"+projName+"/issues/"+issueId+"/comments/full");
>> >
>> > postRequest.setHeader("Authorization", "GoogleLogin auth=" + auth);
>> > postRequest.addHeader("GData-Version", "3.0");
>> > postRequest.addHeader("If-Match", "*");
>> > postRequest.addHeader("Content-Type","application/atom+xml");
>> > postRequest.setEntity(se);
>> >
>> > HttpResponse response = new DefaultHttpClient().execute(postRequest);
>> >
>> >
>> > //Thanks very much for your help!
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> Groups "Project Hosting on Google Code" group.
>> > To post to this group, send email to
>> [email protected].
>> > To unsubscribe from this group, send email to
>> [email protected]<google-code-hosting%[email protected]>
>> .
>> > For more options, visit this group at
>> http://groups.google.com/group/google-code-hosting?hl=en.
>> >
>> >
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Project Hosting on Google Code" group.
>> To post to this group, send email to [email protected]
>> .
>> To unsubscribe from this group, send email to
>> [email protected]<google-code-hosting%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-code-hosting?hl=en.
>>
>>
>
>
> --
> Ing. Juan M. Rodriguez Moreno
> Desarrollador de Sistemas Abiertos
> Sitio: http://proyectofedora.org/mexico
>
>
>
--
Ing. Juan M. Rodriguez Moreno
Desarrollador de Sistemas Abiertos
Sitio: http://proyectofedora.org/mexico
--
You received this message because you are subscribed to the Google Groups
"Project Hosting on Google Code" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-code-hosting?hl=en.