Submit PNG files via POST?

Hi there,

Is there a way to replicate this somehow:

curl --data-binary "@imgf000003.png" https://www.ebi.ac.uk/chembl/api/utils/image2smiles using the KREST nodes?

Thanks in advance, 

George

Hi George,

unfortunately, I see no way to accomplish what you want with the standard KREST nodes: Regardless of the format of the representation you choose, the KREST representation generator always expects object data, i.e. attributes and values.

I see two solutions:

1. You adapt the server to accept e.g. a JSON representation like this:

{ data : <binary image data string> }

and figure a way to read the image files into a string data cell in KNIME (I'm not sure that's easy to do...); or

2. You write a Python script using the requests package and feed it the file URLs you want to POST e.g. with a ListDirectory node. This should not be more than a couple of lines of code; of course, error handling would be a little tricky.

Best regards,

Oliver

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.