Inputs on how to achieve REST based interaction between Java and Python?
<p>I have a <strong>Java</strong> process which interacts with its REST API called from my program's UI. When I receive the API call, I end up calling the (non-REST based) <strong>Python script(s)</strong> which do a bunch of work and return me back the results which are returned back as API response.
- I wanted to convert this interaction of UI API -> JAVA -> calling python scripts to become end to end a REST one, so that in coming times it becomes immaterial which language I am using instead of Python.
- Any inputs on whats the best way of making the call end-to-end a REST based ?</p>

<p>Furthermore, in the future you might want to separate them from the same machine and use network to communicate.</p>

<p>You can use <strong>http</strong> requests.</p>

<p>Make a contract in java of which output you will provide to your python script (or any other language you will use) send the output as a json to your python script, so in that way you can easily change the language as long as you send the same json.</p>

java python rest api