this is my post request:

                        var data = '--END_OF_PART\r\n'+
                        'Content-Type: application/atom+xml\r\n\r
\n'+
                        "<?xml version='1.0' encoding='UTF-8'?>"+
                        '<atom:entry xmlns:atom="http://www.w3.org/2005/Atom";>'+
                        '<atom:category 
scheme="http://schemas.google.com/g/2005#kind";'+
                        ' term="http://schemas.google.com/docs/2007#document";
label="document"/>'+
                        '<atom:title>HCI Methods</atom:title>'+
                        '</atom:entry>\r\n'+
                        '--END_OF_PART\r\n'+
                        'Content-Type: application/msword\r\n\r\n'+
                        serverDoc+'\r\n\r\n'+
                        '--END_OF_PART\r\n';

                        var length = data.length;

                        var Gurl = 
"/proxy/docs.google.com/feeds/documents/private/full";
                        var http = new XMLHttpRequest();
                        http.open('POST', Gurl, true);

                        http.setRequestHeader("Content-Type", 
'multipart/related;
boundary=END_OF_PART');
                        http.setRequestHeader("Content-Length", length);
                        http.setRequestHeader("Authorization", "GoogleLogin
auth="+authToken);
                        http.setRequestHeader("Slug", 
"HCI_usability_methods.doc");

                        http.onreadystatechange = function () {

                                if (this.readyState == 4 && this.status == 201){
                                  uploadedDoc=http.responseText;//Request Done
                                }
                        };
                        http.send(data);

the error i get back is 400 Bad Request.
the responseText: Multipart must have Atom and media part
the serverDoc variable is a full msword doc file, that i got as a
responseText from an earlier request

whats wrong with this?? this is almost identical to the APIs example
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Docs Data APIs" group.
To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com
To unsubscribe from this group, send email to 
google-docs-data-apis+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to