How Java url.openStream () works
I have used the Java url.openStream () command many times to fetch data from the internet. However, I don't know what it does. Does it go through my browser, does it set a separate port, or what?
I would like to know how it works, so I can define how the team will play through the internet anonymizer.
If anyone has any ideas on this subject, I'd really love to hear them.
thanks
a source to share
The call url.openStream()
initiates a new TCP connection to the server to which the URL is resolved. After that, an HTTP GET request is sent over the connection. If all goes well (i.e. 200 OK), the server sends an HTTP response message that carries the data payload that is served at the specified URL. Then you need to read the bytes from the InputStream
returned method openStream()
to get the data payload into your program.
Note. The request does not go through your browser. It is executed by a Java class that acts like an HTTP client running in your JVM.
a source to share