Hello,

i try to create an album via rest api. Please see my code below. As content 
i get the message "*Content-Type text/xml is not a valid input type.*"

Do i misunderstood the api?

Link to 
Api<https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol#AddAlbums>

public void CreateAlbum()
        {
            var client = new 
RestClient("https://picasaweb.google.com/data/feed/api/user/"; + _userId);
            var request = new RestRequest(Method.POST);
            request.AddHeader("Authorization", CONST.PIC_AUTH + _token);
            request.AddHeader("Content-Type", "application/atom+xml");
            string data = "<entry xmlns='http://www.w3.org/2005/Atom'" +
                             "xmlns:media='http://search.yahoo.com/mrss/'" +
                            
 "xmlns:gphoto='http://schemas.google.com/photos/2007'>" +
                             "<title type='text'>Trip To Italy</title>" +
                             "<summary type='text'>This was the recent trip 
I took to Italy.</summary>" +
                             "<gphoto:location>Italy</gphoto:location>" +
                             "<gphoto:access>public</gphoto:access>" +
                            
 "<gphoto:timestamp>1152255600000</gphoto:timestamp>" +
                             "<media:group>" +
                             "<media:keywords>italy, 
vacation</media:keywords>" +
                             "</media:group>" +
                             "<category 
scheme='http://schemas.google.com/g/2005#kind'" +
                            
 "term='http://schemas.google.com/photos/2007#album'></category>" +
                             "</entry>";

            request.AddBody(data);

            try
            {
                client.ExecuteAsync(request, (response) =>
                {

                    MessageBox.Show(response.Content); //*Content-Type 
text/xml is not a valid input type.*

                });
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }

        }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Picasa Web Albums API" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-picasa-data-api/-/oTd-MAZtCasJ.
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-picasa-data-api?hl=en.

Reply via email to