Post to email migration API gives error 411 Length Required

10 views
Skip to first unread message

Jeffrey McKay

unread,
Mar 6, 2012, 1:30:57 PM3/6/12
to google-app...@googlegroups.com
I'm trying to use the Email Migration API.  I've authenticated with ClientLogin.  I believe I have done the POST correctly, but the server
responds with error 411 Length required.   The returned html says "POST requests require a Content-length header".  I am using CURL
to send the post (via a C++ program).  The trace from CURL shows the Content-Length header present.  I have also tried putting it in the
data that I am sending (example below).  Nothing moves the needle - I can't get rid of the error.  Any ideas?
 
------=_Part_0_25934938.1266495790627
Content-Type: application/atom+xml
Content-Length: 1318
 
<?xml version=&apos;1.0&apos; encoding=&apos;UTF-8&apos;?><entry xmlns=&apos;http://www.w3.org/2005/Atom&apos;
xmlns:apps=&apos;http://schemas.google.com/apps/2006&apos;>
<category scheme=&apos;http://schemas.google.com/g/2005#kind&apos; term=&apos;http://schemas.google.com/apps/2006#mailItem&apos;/>
<atom:content xmlns:atom=&apos;http://www.w3.org/2005/Atom&apos; type=&apos;message/rfc822&apos;/>
<apps:mailItemProperty value=&apos;IS_INBOX&apos;/>
 
------=_Part_0_25934938.1266495790627
Content-Type: message/rfc822
 
MIME-Version: 1.0
Received: by 10.216.170.147 with HTTP; Fri, 26 Mar 2010 12:54:28 -0700 (PDT)
Date: Sat, 27 Mar 2010 03:54:28 +0800
Delivered-To:
da...@example.com
Message-ID: <203b3a4f1043461254v148...@mail.gmail.com>
Subject: hello multipart
From: Elizabeth Bennet <
ben...@example.com>
To: Fitzwilliam Darcy <
da...@example.com>
Content-Type: multipart/alternative; boundary=000e0cdf7740f8017e0482b9877a
--000e0cdf7740f8017e0482b9877a
Content-Type: text/plain; charset=ISO-8859-1
howdy multipart!
--000e0cdf7740f8017e0482b9877a
Content-Type: text/html; charset=ISO-8859-1
howdy multipart!
--000e0cdf7740f8017e0482b9877a--
------=_Part_0_25934938.1266495790627
 

Claudio Cherubino

unread,
Mar 6, 2012, 2:26:41 PM3/6/12
to google-app...@googlegroups.com
Hi Jeffrey,

Are you sending the Content-Type HTTP header?


Claudio

 

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/T5mTJnCSlIAJ.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.

Jeffrey McKay

unread,
Mar 6, 2012, 2:59:06 PM3/6/12
to google-app...@googlegroups.com
I seem to have fixed this by putting the content-length header first, but have more problems.  Please see my new topic.

On Tuesday, March 6, 2012 11:26:41 AM UTC-8, Claudio Cherubino wrote:
Claudio

On Tue, Mar 6, 2012 at 10:30 AM, Jeffrey McKay <jmcka...@gmail.com> wrote:
I'm trying to use the Email Migration API.  I've authenticated with ClientLogin.  I believe I have done the POST correctly, but the server
responds with error 411 Length required.   The returned html says "POST requests require a Content-length header".  I am using CURL
to send the post (via a C++ program).  The trace from CURL shows the Content-Length header present.  I have also tried putting it in the
data that I am sending (example below).  Nothing moves the needle - I can't get rid of the error.  Any ideas?
 
------=_Part_0_25934938.1266495790627
Content-Type: application/atom+xml
Content-Length: 1318
 
<?xml version=&apos;1.0&apos; encoding=&apos;UTF-8&apos;?><entry xmlns=&apos;http://www.w3.org/2005/Atom&apos;
xmlns:apps=&apos;http://schemas.google.com/apps/2006&apos;>
<category scheme=&apos;http://schemas.google.com/g/2005#kind&apos; term=&apos;http://schemas.google.com/apps/2006#mailItem&apos;/>
<atom:content xmlns:atom=&apos;http://www.w3.org/2005/Atom&apos; type=&apos;message/rfc822&apos;/>
<apps:mailItemProperty value=&apos;IS_INBOX&apos;/>
 
------=_Part_0_25934938.1266495790627
Content-Type: message/rfc822
 
MIME-Version: 1.0
Received: by 10.216.170.147 with HTTP; Fri, 26 Mar 2010 12:54:28 -0700 (PDT)
Date: Sat, 27 Mar 2010 03:54:28 +0800
Delivered-To:
da...@example.com

Subject: hello multipart
From: Elizabeth Bennet <
ben...@example.com>
To: Fitzwilliam Darcy <
da...@example.com>
Content-Type: multipart/alternative; boundary=000e0cdf7740f8017e0482b9877a
--000e0cdf7740f8017e0482b9877a
Content-Type: text/plain; charset=ISO-8859-1
howdy multipart!
--000e0cdf7740f8017e0482b9877a
Content-Type: text/html; charset=ISO-8859-1
howdy multipart!
--000e0cdf7740f8017e0482b9877a--
------=_Part_0_25934938.1266495790627
 

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/T5mTJnCSlIAJ.
To post to this group, send email to google-apps-mgmt-apis@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt-apis+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages