I'm trying to follow the simple GData Python Blogger example:
http://code.google.com/apis/blogger/developers_guide_python.html
It's not working, however: I get an error message from the Google
servers.
I'm using the standard Ubuntu 8.04 install. I tried the svn version
of python-gdata with the same result. I also pulled over
wpttoblogger.py, someone else's code, and it, too, gives the same
result.
Does anybody know what's going on?
Tom
VERSION
Python 2.5.2 (r252:60911, Apr 21 2008, 11:17:30)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
CODE
import gdata
from gdata import service
from gdata import atom
blogger_service = service.GDataService("foo","bar")
blogger_service.source = 'toms-test-0.1'
blogger_service.service = 'blogger'
blogger_service.server = '
www.blogger.com'
blogger_service.ProgrammaticLogin()
blog_id = '...'
entry = gdata.GDataEntry()
entry.title = atom.Title('xhtml',"hello, world")
entry.content = atom.Content('html','',"here's some content")
result = blogger_service.Post(entry,'/feeds/%s/posts/default'%blog_id)
RESPONSE
Traceback (most recent call last):
File "/tmp/py13044ui2", line 14, in <module>
result = blogger_service.Post(entry,'/feeds/%s/posts/
default'%blog_id)
File "/usr/lib/python2.5/site-packages/gdata/service.py", line 677,
in Post
media_source=media_source, converter=converter)
File "/usr/lib/python2.5/site-packages/gdata/service.py", line 805,
in PostOrPut
'reason': server_response.reason, 'body': result_body}
RequestError: {'status': 400, 'body': '[Line 2, Column 84, element
ns0:content] Malformed MIME type', 'reason': 'Bad Request'}