def create_case_observable(self, case_id, case_observable):
req = self.url + "<STR_LIT>".format(case_id)<EOL>if case_observable.dataType == '<STR_LIT:file>':<EOL><INDENT>try:<EOL><INDENT>mesg = json.dumps({ "<STR_LIT>": case_observable.dataType,<EOL>"<STR_LIT:message>": case_observable.message,<EOL>"<STR_LIT>": case_observable.tlp,<EOL>"<STR_LIT>": case_observable.tags,<EOL>"<STR_LIT>": case_observable.ioc<EOL>})<EOL>data = {"<STR_LIT>": mesg}<EOL>return requests.post(req, data=data, files=case_observable.data[<NUM_LIT:0>], proxies=self.proxies, auth=self.auth, verify=self.cert)<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise CaseObservableException("<STR_LIT>".format(e))<EOL><DEDENT><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return requests.post(req, headers={'<STR_LIT:Content-Type>': '<STR_LIT:application/json>'}, data=case_observable.jsonify(), proxies=self.proxies, auth=self.auth, verify=self.cert)<EOL><DEDENT>except requests.exceptions.RequestException as e:<EOL><INDENT>raise CaseObservableException("<STR_LIT>".format(e))<EOL><DEDENT><DEDENT>
:param case_id: Case identifier
:param case_observable: TheHive observable
:type case_observable: CaseObservable defined in models.py
:return: TheHive observable
:rtype: json