【发布时间】:2016-11-22 17:56:06
【问题描述】:
我在 python 中使用 Gmail API,收到一个请求:
gmail_auth = GmailUserSocialAuth.objects.filter(uid='...')[0]
response = gmail_auth.request('get', '...')
data = response.json()
response - gmail_auth.request('get', '/%s' % data['messages'][0]['id']
message = response.json()
当我打印出消息时,我会得到包含所有字段等的大型对象。通过其中一条消息,我得到以下回复:
{
... # a lot of fields
u'sizeEstimate': 10100,
'html_body': '',
'decoded_body': '',
u'snippet': u'Hi —, <content of email>. On Jun 30, 2016..., Ofek Gila <...> wrote: <content of previous email in thread>.',
}
无论如何,问题是我知道这封电子邮件是写的,因为它出现在 sn-p 中,但它没有出现在消息对象的其他任何地方。
知道会发生什么吗?
提前致谢!
【问题讨论】:
标签: python email gmail gmail-api