minicloud_username = 'xxx'
minicloud_password = 'yyy'
minicloud_url = 'http://api.minicloud.com.cn/statuses/update.json'
def post(self):
content_str = json.dumps({'content' : self.request.get('text')})
auth_str = "Basic " + base64.encodestring(minicloud_username) + ":" +
base64.encodestring(minicloud_password)
headers = {"Content-type" : "text/x-json; charset=UTF-8",
"Content-length" : len(content_str ),
"Authorization" : auth_str }
result = urlfetch.fetch(minicloud_url, content_str, 'POST', headers)
self.response.out.write(result.status_code)
self.response.out.write(result.content)
代码可以正确执行,且调用fetch后,response返回的status_code=200,看帮助上说如果update成功会返回发送的文本,而
这里返回的content却为空,当然登录digu后,也没有看到发送的文字,请问这是什么原因呢?
谢谢ppluck_chen支持!!