Hi,
I need to do a Http POST request to a 3rd party API. I need to send two files and some data.
In python i use requests.post(url, data=json_data, files=filesHolder) where json_data and filesHolder are dictionary and they are as follows:-
json_data={‘key’:value}
filesHolder = {‘file1’:open(‘somefile1.txt’, ‘r’), ‘file2’:open(‘somefile2.txt’, ‘r’)}
I need to realize this from openHAB rules/scripts. Eclipse smart home provides the following 2 implementations for HTTP POST request:-
sendHttpPostRequest(String url) : String - HTTP
sendHttpPostRequest(String url, String contentType, String content) : String - HTTP
How do I use the above sendHttpPostRequest function to do what I did in python??
Regards,
Abin