def sync(self, collectionId, sync_key=0, get_body=False):
if sync_key == 0 and collectionId in self.collection_data:
sync_key = self.collection_data[collectionId]["key"]
sync_url = self.add_parameters(self.get_url(), {"Cmd":"Sync", "User":self.username, "DeviceId":self.device_id, "DeviceType":self.device_type})
d = self.agent.request(
'POST',
sync_url,
Headers({'User-Agent': ['python-EAS-Client %s'%version],
'Authorization': [self.authorization_header()],
'MS-ASProtocolVersion': [self.server_version],
'X-MS-PolicyKey': [str(self.policy_key)],
'Content-Type': ["application/vnd.ms-sync.wbxml"]}),
SyncProducer(collectionId, sync_key, get_body, verbose=self.verbose))
d.addCallback(self.wbxml_response)
d.addCallback(self.process_sync, collectionId)
d.addErrback(self.activesync_error)
return d
评论列表
文章目录