I am trying to send file using java, i have a existing python which is working which needs to be converted to java.
Below is my python code,
with io.open('test.text', 'rb') as f:
r = requests.request("POST",'http://my_url/post', data=f)
My java code
HttpURLConnection httpUrlConnection = null;
URL url = new URL("http://my_url/post");
httpUrlConnection = (HttpURLConnection) url.openConnection();
httpUrlConnection.setRequestMethod("POST");
Now i am not sure how to pass the file to the post request