4 messages in com.googlegroups.bloggerdevRe: Problem when I tried to add a pos...
FromSent OnAttachments
ivan28 Nov 2006 19:09 
Gautam28 Nov 2006 22:21 
Iúri Chaer29 Nov 2006 04:41 
Pete Hopkins ☠29 Nov 2006 10:17 
Subject:Re: Problem when I tried to add a post to blogger manually.
From:Gautam (bha@gmail.com)
Date:11/28/2006 10:21:09 PM
List:com.googlegroups.bloggerdev

Hi Ivan,

I too faced the same "Content is not allowed in prolog" error. I am using CURL to send HTTP requests. The reason this was happening for me was that i was using the same HTTP Request and response object to make a new HTTP call after I had gotten the 302 error. After creating a new Request and Response object, it went through fine. I am not sure why, but it worked :)

Hope this helps

-Gautam

ivan wrote:

Hi everyone,

I've been trying to add a post to blogger manually, following the instructions given on http://code.google.com/apis/gdata/blogger.html#Add_Entry_Manual_Installed However, first I found that my POST request got a HTTP 302 response.

I then attempted to redirect my POST request to the beta.blogger.com, but I got an HTTP 404 error instead.

A complete Ethereal trace of the code is shown below:

GET /feeds/245829312215027211/posts/default HTTP/1.1

Cache-Control: no-cache

Pragma: no-cache

User-Agent: Java/1.5.0_06

Host: beta.blogger.com

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

Content-type: application/x-www-form-urlencoded

HTTP/1.1 200 OK

Last-Modified: Mon, 27 Nov 2006 21:46:01 GMT

Cache-Control: max-age=0, must-revalidate, private

Content-Type: application/atom+xml; charset=UTF-8

Content-Length: 1869

Date: Wed, 29 Nov 2006 03:04:03 GMT

Server: GFE/1.3

<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/'><id>tag:blogger.com,1999:blog-245829312215027211</id><updated>2006-11-27T13:46:01.332-08:00</updated><title type='text'>Ivan's Diary</title><link rel='alternate' type='text/html' href='http://ultimateivan.blogspot.com/index.html'></link><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://ultimateivan.blogspot.com/feeds/posts/default'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/245829312215027211/posts/default'></link><author><name>Ivan Sebastian Surya</name></author><generator version='7.00' uri='http://beta.blogger.com'>Blogger</generator><openSearch:totalResults>1</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>1</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-245829312215027211.post-8632598887196294514</id><published>2006-11-27T13:44:00.000-08:00</published><updated>2006-11-27T13:46:00.906-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='first entry'></category><title type='text'>My very first blog.</title><content type='html'>Hello,&lt;br /&gt;&lt;br /&gt;This is my very first blog entry</content><link rel='alternate' type='text/html' href='http://ultimateivan.blogspot.com/2006/11/my-very-first-blog.html'></link><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/245829312215027211/posts/default/8632598887196294514'></link><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/245829312215027211/posts/default/8632598887196294514'></link><author><name>Ivan Sebastian Surya</name></author></entry></feed>POST /feeds/245829312215027211/posts/default HTTP/1.1

Content-type: application/atom+xml

Authorization: GoogleLogin auth=DQAAAHUAAAB28chjC0wyXqQlmMpQPVheQeWO0wHfkqqRyGNN7mskrN0_KyALe_IwFBLDusCouyi6J2kwmD9MkG1yBrpQGve0FaF5cI57UWldn2Bv-aDDVLCQj6Lu4s-oR2AsWk4FMeAU0euApAa7_u63cs_qVOnLTP_4Lo6kmiGrz2l69HOOqw

Cache-Control: no-cache

Pragma: no-cache

User-Agent: Java/1.5.0_06

Host: beta.blogger.com

Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2

Connection: keep-alive

Content-Length: 418

%3Centry+xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2005%2FAtom%27%3E%3Ctitle+type%3D%27text%27%3EEntry+through+client%3C%2Ftitle%3E%3Ccontent+type%3D%27xhtml%27%3E%3Cdiv+xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3ESee+if+this+can+get+to+my+blog.%3C%2Fdiv%3E%3C%2Fcontent%3E%3Cauthor%3E%3Cname%3EIvan+Sebastian+Surya%3C%2Fname%3E%3Cemail%3Eivansebastiansurya%40gmail.com%3C%2Femail%3E%3C%2Fauthor%3E%3C%2Fentry%3EHTTP/1.1 400 Bad Request

Content-Type: text/plain; charset=iso-8859-1

Cache-control: private

Content-Length: 64

Date: Wed, 29 Nov 2006 03:04:03 GMT

Server: GFE/1.3

org.xml.sax.SAXParseException: Content is not allowed in prolog.

Any idea why this may be the case? I would appreciate it if anyone can help me out. Thanks.

Ivan.