如http://developers.facebook.com/docs/api#publishing中所述,我想发布更新用户状态的帖子请求.如何在python/django中发帖请求?
Django与它没什么关系,但urrlib2.urlopen是一个简单的方法POST.只需使用第二个参数data(第一个是您正在寻址的URL)调用它,其中包含您发布的application/x-www-form-urlencoded格式化数据(正如文档所述,使用urllib.urlencode编码映射,通常是字典,以这种方式).
import urllib2
urllib2.urlopen('http://example.com', 'a=1&b=2')
Run Code Online (Sandbox Code Playgroud)
将发送请求到http://example.com,参数a = 1且b = 2