Java URL getContent() MethodThe getContent() Method of URL gets the contents of this URL. This method is a shorthand for openConnection().getContent(). SyntaxReturnsThe contents of this URL. ThrowIOException - if an I/O exception occurs. Example 1Test it NowOutput: Given Url is : https://www.javatpoint.com/ The content of given url is: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream@feb3fa Example 2Test it NowOutput: sun.net.www.protocol.http.HttpURLConnection$HttpInputStream The mime type is : text/html; charset=iso-8859-1 Next TopicJava URL Class |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India