I need to send both JSON and a CSV file in a POST to a third party API:
curl -H "aToken:$TOKEN" --form-string 'json={"project": "1234", "template": "5678","data":[{"date": "2017-05-26","place": "my house"}, {"person":"alice"}]}' -F 'file=@path/to/file.csv' 'https://the.api.com/api/23/postData'
I would prefer to use HTTPUrlConnection but my understanding is that I can only send one type of data at a time. Maybe I could call Curl using ProcessBuilder but would like to find a native java solution.