We can now upload stix object directly. File is not necessary.

pull/653/head
Remy Dewailly 2020-11-03 13:17:16 +01:00
parent 115bc59425
commit be2b8b4ce7
1 changed files with 3 additions and 0 deletions

View File

@ -2541,6 +2541,9 @@ class PyMISP:
else:
raise MISPServerError("please fill path or data parameter")
if isinstance(to_post, bytes):
to_post = to_post.decode() # type: ignore
if str(version) == '1':
url = urljoin(self.root_url, '/events/upload_stix')
response = self._prepare_request('POST', url, data=to_post, output_type='xml') # type: ignore