忍者ブログ

dothikoの作業日誌自分用作業日誌という実験

[] [PR]

()

2025年 08月14日
×

[PR]上記の広告は3ヶ月以上新規記事投稿のないブログに表示されています。新しい記事を書く事で広告が消えます。

[65] OAuthではてなブログAtompub APIでの投稿に成功!!!

(ブログ/サイトデザイン)

2014年 09月10日
うおおおおおおおおおおおおおおおおおおおおっ!!
遂に!
遂にやったでー!!

        tmpl=self.get_template('post_entry')
        body=tmpl.render(args)

        header={}
        header['Content-Type']='application/xml'
        resp, content=self.client.request("%s/entry" % self.baseURL,'POST',str(body),header)

        if resp['status'] != '201':
            self.output_error("STATUS:%s" % resp['status'])
            self.output_error(str(content))


どうもcontent-typeと書いていたのがアカンかったみたいです。
Content-Typeとしっかり書かないと。

/usr/lib/python2.7/dist-packages/oauth2/__init__.pyのソースを見ないとわからんかった感じ。

ipythonでわざと例外出してそのファイルが本当はどこなのか?調べるというバッドノウハウをメモしておこう。
PR
Comment
name
title
color
mail
URL
comment
pass   Vodafone絵文字 i-mode絵文字 Ezweb絵文字
コメントの修正にはpasswordが必要です。任意の英数字を入力して下さい。