Hello TAXII2-client maintainers,
I'm encountering an issue while trying to fetch objects from the MITRE ATT&CK TAXII server using the TAXII 2.1 client library. Below is a brief description of the code I'm using and the error that occurs.
Code:
from taxii2client.v21 import Collection
coleccion_datos = Collection("https://attack-taxi.mitre.org/api/v21/collections")
coleccion_objetos = coleccion_datos.get_objects("x-mitre-collection--1f5f1533-f617-4ca8-9ab4-6a02367fa019")
Error:
taxii2client.exceptions.TAXIIServiceException: Unexpected Response. Got Content-Type: 'application/stix+json; charset=utf-8; version=2.1' for Accept: 'application/taxii+json;version=2.1'
If you are trying to contact a TAXII 2.0 Server use 'from taxii2client.v20 import X'
If you are trying to contact a TAXII 2.1 Server use 'from taxii2client.v21 import X'.
I'm following the documentation for TAXII 2.1 and the MITRE ATT&CK server. However, the library expects a Content-Type: application/taxii+json, but the server responds with application/stix+json. When inspecting the response, I confirmed that it's STIX content coming from the server, which seems logical because MITRE provides STIX data.
To try to resolve the issue, I manually changed the accept header in the request like this:
coleccion_objetos = coleccion_datos.get_objects(accept="application/stix+json;version=2.1")
However, It still doesn't work.
How can I properly resolve this issue? Is there an alternative approach to handle this Content-Type mismatch without manual workarounds?
Thank you for your assistance!
Hello TAXII2-client maintainers,
I'm encountering an issue while trying to fetch objects from the MITRE ATT&CK TAXII server using the TAXII 2.1 client library. Below is a brief description of the code I'm using and the error that occurs.
Code:
Error:
I'm following the documentation for TAXII 2.1 and the MITRE ATT&CK server. However, the library expects a Content-Type: application/taxii+json, but the server responds with application/stix+json. When inspecting the response, I confirmed that it's STIX content coming from the server, which seems logical because MITRE provides STIX data.
To try to resolve the issue, I manually changed the accept header in the request like this:
coleccion_objetos = coleccion_datos.get_objects(accept="application/stix+json;version=2.1")However, It still doesn't work.
How can I properly resolve this issue? Is there an alternative approach to handle this Content-Type mismatch without manual workarounds?
Thank you for your assistance!