-1

when you open a connection via URLConnection to read the content of a Webpage,

try {
     URL url = new URL("https://stackoverflow.com/questions/46939965/does-java-urlconnection-send-metadata");
     URLConnection urlConnection = url.openConnection();
     HttpURLConnection connection;
     connection = (HttpURLConnection) urlConnection;

     BufferedReader in = new BufferedReader(
        new InputStreamReader(connection.getInputStream()));
     String current;

     while((current = in.readLine()) != null) {
        urlString += current;
     }
  }catch(IOException e) {
     e.printStackTrace();
  }

what will Java leave for Information?
Will statistical data like the Webbrowser saved? Will that be the "Java"?

Thx for help,
~Corn

Reisbrot
  • 37
  • 9

1 Answers1

0

HTTP "metadata" is normally sent in the headers. The one that would indicate the web browser is typically called "USER_AGENT." I do not believe Java will populate these headers for you implicitly.

Igor
  • 33,276
  • 14
  • 79
  • 112