def post_outcome_request(self, **kwargs):
'''
POST an OAuth signed request to the Tool Consumer.
'''
if not self.has_required_attributes():
raise InvalidLTIConfigError(
'OutcomeRequest does not have all required attributes')
header_oauth = OAuth1(self.consumer_key, self.consumer_secret,
signature_type=SIGNATURE_TYPE_AUTH_HEADER,
force_include_body=True, **kwargs)
headers = {'Content-type': 'application/xml'}
resp = requests.post(self.lis_outcome_service_url, auth=header_oauth,
data=self.generate_request_xml(),
headers=headers)
outcome_resp = OutcomeResponse.from_post_response(resp, resp.content)
self.outcome_response = outcome_resp
return self.outcome_response
评论列表
文章目录