Speed up development with full-stack environments for every branch.

Learn More

tyu [Java, url, INPUTSTREAM and BufferedReader]

Forked from Java HTTPS Client Example.

1 Runs 4 Views 0 Copies

In this example we are getting the content header from a HTTPS Client-Server Connection. We are using this website: https://www.google.com



popandrioxck 1

published 3 months ago

import java.net.URL;
import java.io.*;
import javax.net.ssl.HttpsURLConnection;

public class JavaHttpsExample
public static void main(String[] args)
throws Exception
String httpsURL = "https://www.google.com/";
URL myurl = new URL(httpsURL);
HttpsURLConnection con = (HttpsURLConnection)myurl.openConnection();
InputStream ins = con.getInputStream();
InputStreamReader isr = new InputStreamReader(ins);
BufferedReader in = new BufferedReader(isr);

String inputLine;

while ((inputLine = in.readLine()) != null)

Please login/signup to get access to the terminal.

Your session has timed out.

Dismiss (the page may not function properly).