I mean that the URL http://www.google.com/calendar/feeds/default/private/full is available only if your are authentified.before.
On Oct 21, 10:18 am, miky <[email protected]> wrote: > i have already got the auth token before.. do you mean that i have to > add username, password again in the header?? > > sorry but i cant understand very good what you said. > :) > > On 21 Ott, 08:18, florent devin <[email protected]> wrote: > > > I see nowhere the way you fix the default user. To use a default calendar, > > you must be "authenticated" before. That means you have to post the > > userName, and the password. > > > 2009/10/20 miky <[email protected]> > > > > hi, i have this issue: when i try to add a new event i get 401 error. > > > The login athttps://www.google.com/accounts/ClientLoginisOK and i > > > get the Authorization token. > > > > This is my code: > > > > //////////////////////////////////////////////////////////////////////////////////////////////////////////// > > > private void addEvent(){ > > > String body, param, risposta, gsessionid; > > > > try { > > > > body = "GoogleLogin auth="+auth+"\n\n"+"<entry xmlns=\'http:// > > >www.w3.org/2005/Atom\' xmlns:gCal=\'http://schemas.google.com/gCal/ > > > 2005\'><content type=\"html\">Tennis with John April 11 3pm-3:30pm</ > > > content><gCal:quickadd value=\"true\"/></entry>"; > > > > URL url = new URL("http://www.google.com/calendar/feeds/default/ > > > private/full<http://www.google.com/calendar/feeds/default/%0Aprivate/full> > > > "); > > > HttpURLConnection conn = (HttpURLConnection) url.openConnection(); > > > conn.setRequestMethod("POST"); > > > HttpURLConnection.setFollowRedirects(true); > > > conn.setDoInput(true); > > > conn.setDoOutput(true); > > > conn.setUseCaches(false); > > > conn.setRequestProperty("Content-Type", "application/atom+xml"); > > > conn.setRequestProperty("Authorization", "GoogleLogin auth="+auth); > > > conn.setRequestProperty("Content-Length", ""+body.length()); > > > > OutputStream os = conn.getOutputStream(); > > > os.write(body.getBytes()); > > > > /////////////////////////////////////////////////////////////////////////////////////////////// > > > any suggestion?? > > > > tx!! > > > Miky > > > -- > > Florent Devin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Calendar Data API" 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-calendar-help-dataapi?hl=en -~----------~----~----~----~------~----~------~--~---
