【发布时间】:2014-12-16 02:53:52
【问题描述】:
我确定我做错了一些简单的事情,但我一生都无法弄清楚如何将“IsRead”属性设置为 true。这是我的过程的最后一步,它获取过滤的消息列表并存储和处理任何附件。
根据文档,“IsRead”是可写的:http://msdn.microsoft.com/office%5Coffice365%5CAPi/complex-types-for-mail-contacts-calendar#ResourcesMessage
我正在使用 python 2.7 和 requests 模块:
# once file acquired mark the email as read
params = {'IsRead':'True'}
base_email_url = u'https://outlook.office365.com/api/v1.0/me/messages/{0}'.format( msgId )
response = requests.patch(base_email_url, params, auth=(email,pwd))
log.debug( response )
返回的响应是这样的:
{"error":{"code":"ErrorInvalidRequest","message":"Cannot read the request body."}}
我的请求有什么问题?
【问题讨论】:
标签: python rest python-2.7 office365