I saw a similar post which Ryan said was fixed, but I am still getting
it. I am using gdata.py-1.2.4.
Here is a trace from my console. I am trying to update a blog post
from the contents of a local text file (which contains well-formed
HTML which would be under a HTML body tag, ie the contents of the
entry element.
sujit@sirocco:~$ python
Python 2.5.1 (r251:54863, Jun 15 2008, 18:24:56)
[GCC 4.3.0 20080428 (Red Hat 4.3.0-8)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import gdata
>>> from gdata import service
>>> from gdata import atom
>>> bs = service.GDataService('my_email','my_pass')
>>> bs.source = 'mygdata-bloggerclient-0.1'
>>> bs.service='blogger'
>>> bs.account_type='GOOGLE'
>>> bs.server='
www.blogger.com'
>>> bs.ProgrammaticLogin()
>>> q = service.Query()
>>> q.feed='/feeds/7583720/posts/default'
>>> q.published_min='2009-01-25T20:02:00.000-08:00'
>>> q.published_max='2009-01-25T20:03:00.000-08:00'
>>> q.max_results=1000
>>> feed = bs.Get(q.ToUri())
>>> feed.entry
[<gdata.GDataEntry object at 0x10866d0>]
>>> e = feed.entry[0]
>>> f = open('my_text_file','rb')
>>> ncontent = f.read()
>>> f.close()
>>> e.content = atom.Content('html',ncontent)
>>> bs.Put(e, '/feeds/7583720/posts/default/7439698622276152424')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.5/site-packages/gdata/service.py", line 1304,
in Put
media_source=media_source, converter=converter)
File "/usr/lib/python2.5/site-packages/gdata/service.py", line 1267,
in PostOrPut
'reason': server_response.reason, 'body': result_body}
gdata.service.RequestError: {'status': 400, 'body': '[Line 1336,
Column 17, element ns0:content] Malformed MIME type', 'reason': 'Bad
Request'}
>>>
Would appreciate some help with this.
Thanks very much,
Sujit