If I understand your question correctly,
Java provides classes in the java.net package which let you create a URL addressing a server resource, create a request and handle the returned response data.
See for example java.net.URLConnection and HttpURLConnection.
Bill