Hi all,
I am using the below code to obtain the feed URL for calendar However
getting the Moved Temporarily issue, could any body look at the code and let
me know where I am making mistake.
URL url = new URL(CALENDAR_DEFAULT_FEED);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
// Form AuthSub authentication header
String authHeader = null;
authHeader = AuthSubUtil.formAuthorizationHeader(sessionToken,
null,
url,
"GET");
connection.setRequestProperty("Authorization", authHeader);
connection.setInstanceFollowRedirects(false);
int responseCode = connection.getResponseCode();
if (responseCode == HttpURLConnection.HTTP_MOVED_PERM ||
responseCode == HttpURLConnection.HTTP_MOVED_TEMP) {
CALENDAR_DEFAULT_FEED = connection.getHeaderField("Location");
}
try {
BufferedReader reader =
new BufferedReader(new InputStreamReader(
connection.getInputStream()));
String line;
while((line = reader.readLine()) != null) {
out.println(line);
}
} catch(IOException e) {
// Ignore
}
I am eagerly waiting for reply.
Thanks
Jack,
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---