I've been trying to develop a desktop java app which can upload an image from local hard disk to my website and get a URL of a page dynamically created in PHP for that image. I came across HttpClient which can send a POST request, but has a lot of deprecated classes and I haven't seen how to get some information back from server besides HTTP status codes. Second approach which I am not familiar with and would really like to avoid is rebuilding a server side in JAVA.
Which would be the simplest solution for uploading a file via upload form (which is processed in PHP) and getting back some information like new URL of image to the JAVA application?