Version: 1.1.119

libtaxii Module

Functions

libtaxii.get_message_from_http_response(http_response, in_response_to)[source]

Create a TAXII message from an HTTPResponse object.

This function parses the httplib.HTTPResponse by reading the X-TAXII-Content-Type HTTP header to determine if the message binding is supported. If the X-TAXII-Content-Type header is present and the value indicates a supported Message Binding, this function will attempt to parse the HTTP Response body.

If the X-TAXII-Content-Type header is not present, this function will attempt to build a Failure Status Message per the HTTP Binding 1.0 specification.

If the X-TAXII-Content-Type header is present and indicates an unsupported Message Binding, this function will raise a ValueError.

Parameters:
  • http_response (httplib.HTTPResponse) – the HTTP response to parse
  • in_response_to (str) – the default value for in_response_to