So I've struggling with this one lately. There are multiple ways to make a HTTP POST request with Java, some of which demonstrate with HttpClient
3.x and the others with HttpClient
4.x
I'm assuming that the 4.x line is more advanced, but there are also lacking tutorials with this one. At least for me, I had hard time to find some beginner friendly guides.
I'd like to make a POST request with an encoded File
object.
Some of the tutorials I've followed also mentioned NameValuePair
, but for me this class is not available and I don't know how to obtain it. So if you answer, please mention how I can get hold of the imports as well.
Please demonstrate a minimal HTTP POST request with HttpClient
4.x