Would you enjoy being able to cURL something within one command line in java ?
Seems sometimes annoying to instantiate an HttpPost, or even an HttpClientBuilder, with its fluent interface.
What I suggest you is to use my code sample, to enhance it and to transform it in your customized cURL command. You can even add custom arguments to it, so the commands will be shorter to type.
How to use it ? Like a normal curl !
Response curlResponse = curl(" -X'POST' -H'Content-Type:application/x-www-form-urlencoded' -d 'token=mytoken&channel=mychannel' 'https://slack.com/api/chat.postMessage'")
Here you are, with a curl response that you are able to read easily with the HttpClient API.
Where is this code sample ? There : https://gist.github.com/libetl/edd72cca5464aa403395029430360344
BTW, this blog is now 8 years old, and this is the 200th post… way to go.