I have been trying to implement custom request method in HTTP header while posting my data to the server URL. My application specific URL accepts -X parameter and -d for the data. Basically I am trying to dump JSON data into my influx DB using CURL command which is working fine. But the issue is, if I am implementing the same in java with proper approach, it is not supported or working.
My CURL command is :
curl -X POST -d 'my_json_data' 'my_url'
How can I implement the same in java using HttpUrlConnection or other available approach i.e- Apache Client service.