Hi, Try the following entry:
<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'> <category scheme='http://schemas.google.com/g/2005#kind' term='http://schemas.google.com/contact/2008#group' /> <title>testGroupPerl5</title> <content>google</content> </entry> Also, you need to close the requestStream and read the response: Stream requestStream = request.GetRequestStream(); requestStream.Write(bytes, 0, bytes.Length); requestStream.Close(); restResponse = (HttpWebResponse)request.GetResponse(); StreamReader responseStream = new StreamReader (restResponse.GetResponseStream()); string content = responseStream.ReadToEnd(); -julian On Mar 13, 3:52 am, "M. FarouQ" <[email protected]> wrote: > Greetings, I'm trying to create a contact group using a .Net POST > HttpWebRequest as explained > here:http://code.google.com/apis/contacts/docs/1.0/developers_guide_protoc... > > I'm using the following code: > > string atomEntry = "<atom:entry xmlns:gd='http://schemas.google.com/g/ > 2005'><atom:category scheme='http://schemas.google.com/g/2005#kind' > term='http://schemas.google.com/contact/2008#group'/><atom:title > type='text'>Salsa group</atom:title><gd:extendedProperty name='more > info about the group'><info>Nice people.</info></gd:extendedProperty></ > atom:entry>"; > > byte[] bytes = Encoding.UTF8.GetBytes(atomEntry); > > HttpWebRequest request = (HttpWebRequest) WebRequest.Create("http:// > www.google.com/m8/feeds/groups/[email protected]/full"); > > request.Headers.Add("Authorization", "GoogleLogin " + > "auth="+authToken); > request.Method = "POST"; > request.ContentLength = bytes.Length; > request.ContentType = "application/atom+xml"; > using (Stream requestStream = request.GetRequestStream()) > { > requestStream.Write(bytes, 0, bytes.Length);} > > _______________________________ > > But no group is created. I tried different encoding types but still it > doesn't work. > Any help would be appreciated. Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Contacts 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-contacts-api?hl=en -~----------~----~----~----~------~----~------~--~---
