The uri cannot be wrong otherwise the error would have been 404-Not Found
Since the error is Bad Request, You need to trap the response from the server
when this error is thrown. The response is available in GDataRequestException's
(wrapper) Response property value.
Can you tell me which library/language of Google Calendar API you are using.
The code to get the response in .NET is :
StringBuilder builder = new StringBuilder();
try
{
if (exception.Response != null)
{
Stream receiver = exception.Response.GetResponseStream();
if (receiver != null)
{
// Pipe the stream to ahigher level stream reader with
the default encoding
// format. which is UTF8
StreamReader readStream = new StreamReader(receiver);
// Read 256 charcters at a time.
char[] buffer = new char[256];
int count = readStream.Read(buffer, 0, 256);
while (count > 0)
{
builder.Append(buffer);
count = readStream.Read(buffer, 0, 256);
}
// Release the resources of stream object.
readStream.Close();
receiver.Close();
}
}
}
catch
{
// Do nothing
}
return builder.Replace("\0", "").ToString();
Cheers
----- Original Message ----
From: gao.brian <[EMAIL PROTECTED]>
To: Google Calendar Data API <[email protected]>
Sent: Tuesday, August 21, 2007 3:12:32 PM
Subject: Re: Bad Request when tring to update an existing event. Can something
help with this?
>From the log captured by Wireshark. I saw below scenario happened:
1. my client server send a post to google server,
2. and expect a 100 continue request,
3. then google server reply 100 response,
4, then my client send the data left to google server
5, recv 400 response from google. and also found "Invaild Request URI"
indication from google.
The URI I post to is gotten from google feed data. in xml format.
which likes
<link rel='edit' type='application/atom+xml'
href='http://www.google.com/calendar/feeds/gao.brian%
40gmail.com/private/full/05i0u0an1203c0719rbjn95p6o/63323347188'/>
<author>
If the uri is wrong, How to get the right URI for updating a existing
event? thanks.
On 8月21日, 下午2时58分, Kulvinder Singh <[EMAIL PROTECTED]> wrote:
> You need to trap the response from the server when this error is thrown. The
> response is available in GDataRequestException's (wrapper) Response property
> value.
>
>
>
> ----- Original Message ----
> From: gao.brian <[EMAIL PROTECTED]>
> To: Google Calendar Data API <[email protected]>
> Sent: Tuesday, August 21, 2007 12:25:34 PM
> Subject: Bad Request when tring to update an existing event. Can something
> help with this?
>
> All, I have met a issue when I tring to update an existing event on
> google calendar. below is the error recieved from google calendar
> server.
>
> Authorization: GoogleLogin auth=#####
> Content-type: application/atom+xml
> Content-Length: 1598
> Expect: 100-continue
>
> < HTTP/1.1 100 Continue
> < HTTP/1.1 400 Bad Request
> < Content-Type: text/plain; charset=UTF-8
>
> Did somebody meet such issue? How can get this fixed? Thanks in
> advance.
>
> ___________________________________________________________________________
> _________
> Choose the right car based on your needs. Check out Yahoo! Autos new Car
> Finder tool.http://autos.yahoo.com/carfinder/- 隐藏被引用文字 -
>
> - 显示引用的文字 -
____________________________________________________________________________________
Moody friends. Drama queens. Your life? Nope! - their life, your story. Play
Sims Stories at Yahoo! Games.
http://sims.yahoo.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---