Skip to content
Snippets Groups Projects
Commit 0256b900 authored by David Hoksza's avatar David Hoksza
Browse files

try to utf encode

parent b798b8fa
No related branches found
No related tags found
No related merge requests found
[input]
openTgtFileDir=C:/projects/git/talent/tmp/journal.pcbi.1002577.s002.XML
openTmpFileDir=C:/projects/git/talent/tmp/pd_test2.sbml
openTmpFileDir=C:/projects/git/talent/tmp/glycolisis.xml
openOutputPathButton=C:/projects/git/talent/out
openOutputPath=C:/projects/git/talent/out
opnBcFile=C:/projects/git/talent/out/temp.pkl
opnBcFile=C:/projects/git/talent/out/journalpcbi1002577s002--from--multiple-tgt-ddup_True_tmp-ddup_False.pkl
cbTgtType=1
cbTmpType=1
......@@ -49,11 +49,15 @@ def minerva_convert(in_string: str, in_format: str, out_format: str, minerva_ins
# response = requests.post(api_address, cookies=dict(MINERVA_AUTH_TOKEN=token), data=in_string)
headers = {'Content-Type': 'text/xml; charset=utf-8', }
response = requests.post(api_address, data=in_string, headers=headers)
# response = requests.post(api_address, data=in_string.encode('utf-8'), headers=headers)
response = requests.post(api_address, data=in_string.encode('utf-8'), headers=headers)
if response.status_code == 500:
# TODO: this is not the optimal way. THere is surely a better way how to pass the information about the encoding to the server
response = requests.post(api_address, data=in_string, headers=headers)
result = response.content if out_format == "pdf" or out_format == "png" else response.text
return result
return result co
def sbml_convert(sbml_string: str, format: str, minerva_instance: str):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment